diff --git a/eventtracking/backends/event_bus.py b/eventtracking/backends/event_bus.py index 4b1b1c0..97b41d3 100644 --- a/eventtracking/backends/event_bus.py +++ b/eventtracking/backends/event_bus.py @@ -9,6 +9,7 @@ from openedx_events.analytics.signals import TRACKING_EVENT_EMITTED from openedx_events.event_bus import get_producer +from eventtracking.backends.logger import DateTimeJSONEncoder from eventtracking.backends.routing import RoutingBackend from eventtracking.config import SEND_TRACKING_EVENT_EMITTED_SIGNAL @@ -33,8 +34,8 @@ def send(self, event): if name not in getattr(settings, "EVENT_BUS_TRACKING_LOGS", []): return - data = json.dumps(event.get("data")) - context = json.dumps(event.get("context")) + data = json.dumps(event.get("data"), cls=DateTimeJSONEncoder) + context = json.dumps(event.get("context"), cls=DateTimeJSONEncoder) timestamp = event.get("timestamp")