Force creation of a new trace in continue_trace with empty headers by sl0thentr0py · Pull Request #4682 · getsentry/sentry-python · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions MIGRATION_GUIDE.md
4 changes: 3 additions & 1 deletion sentry_sdk/opentelemetry/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def continue_trace(

span_context = self._incoming_otel_span_context()
if span_context is None:
yield
# force a new trace since no incoming stuff
with use_span(INVALID_SPAN):
yield
else:
with use_span(NonRecordingSpan(span_context)):
yield
Expand Down
19 changes: 19 additions & 0 deletions tests/test_api.py