Skip to content

Commit c80e0f4

Browse files
authored
docs(java): Add docs for propagateTraceparent option (#14859)
## DESCRIBE YOUR PR Add docs for getsentry/sentry-java#4671 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent 12115c9 commit c80e0f4

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

docs/platforms/android/configuration/options.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@ If <PlatformIdentifier name="trace-propagation-targets" /> is not provided, trac
327327

328328
</ConfigKey>
329329

330+
<ConfigKey name="propagate-traceparent">
331+
332+
Controls whether the SDK should propagate the W3C `traceparent` HTTP header alongside the `sentry-trace` and `baggage` headers for distributed tracing. This option defaults to `false` and is available starting from SDK version 8.22.0.
333+
334+
</ConfigKey>
335+
330336
<ConfigKey name="trace-options-requests">
331337

332338
Set this boolean to `false` to disable tracing for `OPTIONS` requests. This options default value will likely be changed in the next major version, meaning you will have to set it to `true` if you want to keep tracing `OPTIONS` requests.

docs/platforms/android/tracing/trace-propagation/index.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,9 @@ SentryAndroid.init(context, { options ->
6363
))
6464
})
6565
```
66+
67+
## W3C Traceparent Header Support
68+
69+
Starting from version 8.22.0, the Java SDK also supports the W3C `traceparent` HTTP header for outgoing requests. This header follows the [W3C Trace Context specification](https://develop.sentry.dev/sdk/telemetry/traces/distributed-tracing/#w3c-trace-context-header) and provides interoperability with other tracing systems that support this standard.
70+
71+
To enable W3C `traceparent` header propagation, set the [`propagateTraceparent`](/platforms/android/configuration/options/#propagate-traceparent) option to `true`. When enabled, the `traceparent` header will be propagated alongside the `sentry-trace` and `baggage` headers to outgoing HTTP requests. Like the other headers, it's attached to all requests by default, or only to requests matching your `tracePropagationTargets` configuration if you've specified one.

docs/platforms/java/common/configuration/options.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,12 @@ If <PlatformIdentifier name="trace-propagation-targets" /> is not provided, trac
277277

278278
</ConfigKey>
279279

280+
<ConfigKey name="propagate-traceparent">
281+
282+
Controls whether the SDK should propagate the W3C `traceparent` HTTP header alongside the `sentry-trace` and `baggage` headers for distributed tracing. This option defaults to `false` and is available starting from SDK version 8.22.0.
283+
284+
</ConfigKey>
285+
280286
<ConfigKey name="trace-options-requests">
281287

282288
Set this boolean to `false` to disable tracing for `OPTIONS` requests. This options default value will likely be changed in the next major version, meaning you will have to set it to `true` if you want to keep tracing `OPTIONS` requests.

docs/platforms/java/common/tracing/trace-propagation/index.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,10 @@ Sentry.init(context, { options ->
6262
"https://api.myproject.org/"
6363
))
6464
})
65-
```
65+
```
66+
67+
## W3C Traceparent Header Support
68+
69+
Starting from version 8.22.0, the Java SDK also supports the W3C `traceparent` HTTP header for outgoing requests. This header follows the [W3C Trace Context specification](https://develop.sentry.dev/sdk/telemetry/traces/distributed-tracing/#w3c-trace-context-header) and provides interoperability with other tracing systems that support this standard.
70+
71+
To enable W3C `traceparent` header propagation, set the [`propagateTraceparent`](/platforms/java/configuration/options/#propagate-traceparent) option to `true`. When enabled, the `traceparent` header will be propagated alongside the `sentry-trace` and `baggage` headers to outgoing HTTP requests. Like the other headers, it's attached to all requests by default, or only to requests matching your `tracePropagationTargets` configuration if you've specified one.

0 commit comments

Comments
 (0)