Repository navigation
feat: add sentry_iter_trace_propagation_headers - #2240
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## jpnurmi/feat/continue-trace #2240 +/- ##
===============================================================
- Coverage 76.27% 76.07% -0.21%
===============================================================
Files 104 104
Lines 29694 29714 +20
Branches 5500 5504 +4
===============================================================
- Hits 22649 22604 -45
- Misses 5663 5736 +73
+ Partials 1382 1374 -8 🚀 New features to boost your workflow:
|
|
@limbonaut Are you using trace propagation APIs from other SDKs yet? Do you happen to have any integration/e2e tests that could verify Native's trace propagation API? Asking because these tests are just running against a mock server... |
|
The tests we have1 in the Godot SDK also run against a mock server. For a proper end-to-end setup, we'd have to introduce a two-app setup with another server SDK sending envelops, I think. UPDATE: If we add Footnotes |
limbonaut
left a comment
There was a problem hiding this comment.
The code and logic are solid. And it's a great addition!
Add `sentry_iter_trace_propagation_headers()` and `sentry_scope_iter_trace_propagation_headers()` to fetch the `sentry-trace` and `baggage` headers for downstream services without an active span, as required by the trace propagation spec's `getTraceData`. Until now, only `sentry_span_iter_headers()` and `sentry_transaction_iter_headers()` existed, so a trace could not be propagated without tracing. The headers come from the span or transaction bound to the scope, if any, otherwise from the scope's propagation context. Without a span, the sampling decision is deferred unless one was inherited with `sentry_continue_trace()`. Per the spec, the `sentry-trace` header then has no sampled flag and the SDK-built baggage has no `sentry-sampled`. The scoped variant falls back to the parent scopes for what the scope does not set. Ref: #2050
201acb1 to
d55742b
Compare
Add
sentry_iter_trace_propagation_headers()and its scoped variant to fetch thesentry-traceandbaggageheaders without an active span, as required by the trace propagation spec's getTraceData.The headers come from the span or transaction bound to the scope, if any, otherwise from its propagation context. Without a span, the sampling decision is deferred unless one was inherited with
sentry_continue_trace(), so thesentry-traceheader has no sampled flag and the baggage nosentry-sampled.Close: #2050