Skip to content

Commit

Permalink
fix(otel): Fix missing baggage (#3218)
Browse files Browse the repository at this point in the history
  • Loading branch information
sentrivana authored Jun 27, 2024
1 parent 0629094 commit dc57972
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions sentry_sdk/integrations/opentelemetry/span_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,17 +279,14 @@ def _get_trace_data(self, otel_span, parent_context):
)
trace_data["parent_span_id"] = parent_span_id

if parent_context is not None:
sentry_trace_data = get_value(SENTRY_TRACE_KEY, parent_context)
sentry_trace_data = cast(
"dict[str, Union[str, bool, None]]", sentry_trace_data
)
trace_data["parent_sampled"] = (
sentry_trace_data["parent_sampled"] if sentry_trace_data else None
)
sentry_trace_data = get_value(SENTRY_TRACE_KEY, parent_context)
sentry_trace_data = cast("dict[str, Union[str, bool, None]]", sentry_trace_data)
trace_data["parent_sampled"] = (
sentry_trace_data["parent_sampled"] if sentry_trace_data else None
)

baggage = get_value(SENTRY_BAGGAGE_KEY, parent_context)
trace_data["baggage"] = baggage
baggage = get_value(SENTRY_BAGGAGE_KEY, parent_context)
trace_data["baggage"] = baggage

return trace_data

Expand Down

0 comments on commit dc57972

Please sign in to comment.