Skip to content

Commit

Permalink
inject baggage into root span
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
  • Loading branch information
Lawouach committed Nov 9, 2023
1 parent 6734666 commit 21aecc0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chaostracing/oltp.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ def started(self, experiment: Experiment, journal: Journal) -> None:
span.set_attribute("chaostoolkit.experiment.title", experiment.get("title"))
span.set_attribute("chaostoolkit.platform.full", platform.platform())

try:
span.set_attributes(baggage.get_all())
except Exception:
logger.debug("Failed to inject OTLP baggage into root span", exc_info=True)

self.root_stack = stack
self.root_span = span
self.current_span = span
Expand Down

0 comments on commit 21aecc0

Please sign in to comment.