Skip to content

Commit

Permalink
Add debugging info for GCP enrich issue
Browse files Browse the repository at this point in the history
We try to find out where the UUID object that cannot be serialized comes
from.
  • Loading branch information
np5 committed Mar 29, 2024
1 parent 7479070 commit 490a875
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion zentral/core/queues/backends/google_pubsub/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,12 @@ def producer_client(self):
return pubsub_v1.PublisherClient(credentials=self.credentials)

def publish_event(self, event, machine_metadata):
message = json.dumps(event.serialize(machine_metadata=machine_metadata)).encode("utf-8")
serialized_event = event.serialize(machine_metadata=machine_metadata)
try:
message = json.dumps(serialized_event).encode("utf-8")
except TypeError:
logger.error("Could not serialize event %s", serialized_event)
raise
kwargs = {"event_type": event.event_type}
if event.metadata.routing_key:
kwargs["routing_key"] = event.metadata.routing_key
Expand Down

0 comments on commit 490a875

Please sign in to comment.