You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/platforms/native/common/configuration/options.mdx
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,12 @@ Whether Crashpad should delay application shutdown until the upload of the crash
64
64
65
65
</ConfigKey>
66
66
67
+
<ConfigKeyname="propagate-traceparent">
68
+
69
+
Controls whether the SDK should propagate the W3C `traceparent` HTTP header alongside the `sentry-trace` header for [distributed tracing](https://docs.sentry.io/platforms/native/tracing/trace-propagation/custom-instrumentation/). This option defaults to `false`.
70
+
71
+
</ConfigKey>
72
+
67
73
## Hooks
68
74
69
75
These options can be used to hook the SDK in various ways to customize the reporting of events.
Copy file name to clipboardExpand all lines: platform-includes/distributed-tracing/custom-instrumentation/native.mdx
+34-2Lines changed: 34 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,14 @@ On this page you will learn how to manually propagate trace information into and
2
2
3
3
To obtain trace headers from a transaction, use `sentry_transaction_iter_headers()`. For a span, use `sentry_span_iter_headers()`. Pass the returned value to the downstream service. If communication happens over HTTP, we recommend you attach all headers to the outgoing HTTP request.
4
4
5
+
By default, only the `sentry-trace` header is generated. To also generate W3C `traceparent` headers for interoperability with other tracing systems, enable traceparent propagation:
When enabled, both `sentry-trace` and `traceparent` headers will be generated with the same trace and span information.
12
+
5
13
Continuing a trace from an upstream service requires using `sentry_transaction_context_update_from_header()`. Before starting a transaction, pass its transaction context into the previous function along with the `sentry-trace` header. The transaction started with the transaction context will contain everything needed to continue the trace.
6
14
7
15
To obtain headers from a transaction so it can be continued from a downstream service, define a function which merges the headers into some aggregate object. Use the function in `sentry_transaction_iter_headers()` as a callback. The following example uses `sentry_value_t` as the aggregate object:
-`sentry-trace`: Uses Sentry's format with sampling flag as "0" or "1"
56
+
-`traceparent`: Uses W3C format with version "00" and sampling flag as "00" or "01"
57
+
58
+
Both headers contain the same trace ID and span ID, ensuring compatibility across different tracing systems.
59
+
60
+
29
61
To create a transaction as a continuation of a trace retrieved from an upstream service, pass an iterator of the incoming headers to the transaction context:
0 commit comments