Skip to content

Commit

Permalink
Fix messaging tracing. Injecting trace data after json serializing fa…
Browse files Browse the repository at this point in the history
…iled; inject prior to serializing.

Signed-off-by: Mike Kingsbury <mike.kingsbury@redhat.com>
  • Loading branch information
mike-kingsbury committed Nov 29, 2023
1 parent 0e3313d commit 8cd8113
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion resultsdb/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,12 @@ def __init__(self, **kwargs):
raise ValueError(f"Missing {attr!r} option for STOMP messaging plugin")

def publish(self, msg):
msg = json.dumps(msg)
# Add telemetry information. This includes an extra key
# traceparent.
TraceContextTextMapPropagator().inject(msg)

msg = json.dumps(msg)

kwargs = dict(body=msg, headers={}, destination=self.destination)

conn = stomp.connect.StompConnection11(**self.connection)
Expand Down

0 comments on commit 8cd8113

Please sign in to comment.