-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs(java): Add docs for propagateTraceparent option #14859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
| ## W3C Traceparent Header Support | ||
|
|
||
| Starting from version 8.22.0, the Android SDK also supports the W3C `traceparent` HTTP header. This header follows the W3C Trace Context specification and provides interoperability with other tracing systems that support this standard. | ||
|
|
||
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bug: The Android documentation for propagateTraceparent is missing the required CORS configuration for the traceparent header, which will cause cross-origin requests to fail.
-
Description: The Android documentation for the new
propagateTraceparentfeature omits the requirement to add thetraceparentheader to the backend'sAccess-Control-Allow-HeadersCORS configuration. When users enable this feature for cross-origin requests, their backend services will reject the requests, causing application failures. This critical information is present in the JavaScript SDK documentation but is missing for Android, creating a functional gap for users of the feature. -
Suggested fix: Update the Android documentation to include the CORS requirement for the
traceparentheader. Add an inline warning in the newtraceparentsection and update the existing 'Dealing with CORS Issues' page to includetraceparentin theAccess-Control-Allow-Headersexample.
severity: 0.75, confidence: 0.95
Did we get this right? 👍 / 👎 to inform future reviews.
|
|
||
| Starting from version 8.22.0, the Java SDK also supports the W3C `traceparent` HTTP header. This header follows the W3C Trace Context specification and provides interoperability with other tracing systems that support this standard. | ||
|
|
||
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential bug: The Java documentation for propagateTraceparent is missing the required CORS configuration for the traceparent header, which will cause cross-origin requests to fail.
-
Description: The Java documentation for the new
propagateTraceparentfeature omits the requirement to add thetraceparentheader to the backend'sAccess-Control-Allow-HeadersCORS configuration. When users enable this feature for cross-origin requests, their backend services will reject the requests, causing application failures. This critical information is present in the JavaScript SDK documentation but is missing for Java, creating a functional gap for users of the feature. -
Suggested fix: Update the Java documentation to include the CORS requirement for the
traceparentheader. Add an inline warning in the newtraceparentsection and update the existing 'Dealing with CORS Issues' page to includetraceparentin theAccess-Control-Allow-Headersexample.
severity: 0.75, confidence: 0.95
Did we get this right? 👍 / 👎 to inform future reviews.
Bundle ReportChanges will increase total bundle size by 6.27kB (0.03%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-server-cjsAssets Changed:
view changes for bundle: sentry-docs-client-array-pushAssets Changed:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markushi This all looks good. Does it make sense to link to info on W3C in these documents? I don't know too much about java, so not sure if this is base knowledge, or helpful for folks to get context.
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.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
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