-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs(js): Add docs for strictTraceContinuation
and orgId
#14459
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -379,6 +379,31 @@ If you want to disable trace propagation, you can set this option to `[]`. | |
|
||
</SdkOption> | ||
|
||
|
||
<PlatformCategorySection supported={["server", "serverless"]}> | ||
<SdkOption name="strictTraceContinuation" type='boolean' defaultValue='false'> | ||
|
||
If set to `true`, the SDK will only continue a trace if the organization ID of the incoming trace found in the | ||
`baggage` header matches the organization ID of the current Sentry client. | ||
|
||
The client's organization ID is extracted from the DSN or can be set with the `orgId` option. | ||
|
||
If the organization IDs do not match, the SDK will start a new trace instead of continuing the incoming one. | ||
This is useful to prevent traces of unknown third-party services from being continued in your application. | ||
|
||
</SdkOption> | ||
|
||
<SdkOption name="orgId" type='`${number}` | number'> | ||
|
||
The organization ID for your Sentry project. | ||
|
||
The SDK will try to extract the organization ID from the DSN. If it cannot be found, or if you need to override it, | ||
you can provide the ID with this option. The organization ID is used for trace propagation and for features like `strictTraceContinuation`. | ||
|
||
</SdkOption> | ||
|
||
|
||
</PlatformCategorySection> | ||
|
||
<PlatformCategorySection supported={['browser']}> | ||
|
||
<SdkOption name="beforeSendTransaction" type='(event: TransactionEvent, hint: EventHint) => TransactionEvent | null'> | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -71,6 +71,39 @@ This configuration lets your app track user actions across: | |||||
|
||||||
If your app crashes while a user is uploading a photo, you can trace exactly where the problem occurred - in the app itself, the main API, or the media service. | ||||||
|
||||||
### Strict Trace Continuation | ||||||
|
||||||
_Available since SDK version 10_ | ||||||
|
||||||
When your application receives requests, they might include `sentry-trace` and `baggage` headers from an upstream service that is also using Sentry. | ||||||
By default, the SDK will continue the trace from the incoming headers. This can be undesirable if the requests are from a third-party service, | ||||||
|
By default, the SDK will continue the trace from the incoming headers. This can be undesirable if the requests are from a third-party service, | |
By default, the SDK will continue the trace from these incoming headers. However, this behavior can be undesirable if the requests are from a third-party service, |
Outdated
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.
To prevent this, you can enable `strictTraceContinuation`. When this option is set to `true`, the SDK checks the incoming request for Sentry trace information. | |
To prevent this, you can enable `strictTraceContinuation`. When this option is set to `true`, the SDK checks the incoming request for Sentry trace information and only continues the trace if it belongs to the same Sentry organization. |
Outdated
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.
It only continues the trace if it belongs to the same Sentry organization. Otherwise, it starts a new trace. | |
Otherwise, it starts a new trace. |
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.