Skip to content

Commit d8049a7

Browse files
feat(python): Add strict_trace_continuation and org_id (#15671)
## DESCRIBE YOUR PR goes with getsentry/sentry-python#5178 preview: https://sentry-docs-git-neel-python-strict-trace.sentry.dev/platforms/python/configuration/options/#strict_trace_continuation ## 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:* - [x] 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) --------- Co-authored-by: Alex Alderman Webb <alexander.webb@sentry.io>
1 parent 5256b53 commit d8049a7

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/platforms/python/configuration/options.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,30 @@ If `trace_propagation_targets` is not provided, trace data is attached to every
378378

379379
</SdkOption>
380380

381+
<SdkOption name="strict_trace_continuation" type='boolean' defaultValue='False'>
382+
383+
If set to `True`, the SDK will only continue a trace if the `org_id` of the incoming trace found in the
384+
`baggage` header matches the `org_id` of the current Sentry client and only if BOTH are present.
385+
386+
If set to `False`, consistency of `org_id` will only be enforced if both are present. If either are missing, the trace will be continued.
387+
388+
The client's organization ID is extracted from the DSN or can be set with the `org_id` option.
389+
If the organization IDs do not match, the SDK will start a new trace instead of continuing the incoming one.
390+
This is useful to prevent traces of unknown third-party services from being continued in your application.
391+
392+
</SdkOption>
393+
394+
<SdkOption name="org_id" type='str'>
395+
396+
An optional organization ID for your Sentry project.
397+
398+
The SDK will try to extract the organization ID from the DSN. If it cannot be found, or if you need to override it (if you use Relay or self-hosted),
399+
you can provide the ID with this option.
400+
401+
The organization ID is used for features like <PlatformLink to="/configuration/options#strict_trace_continuation">strict trace continuation</PlatformLink>.
402+
403+
</SdkOption>
404+
381405
<SdkOption name="functions_to_trace" type='list[str]' defaultValue='[]'>
382406

383407
An optional list of functions that should be set up for tracing. For each function in the list, a span will be created when the function is executed.

0 commit comments

Comments
 (0)