From 092ade65df69697f0780f66847cbe08c7561680b Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Mon, 1 Dec 2025 14:46:15 +0100 Subject: [PATCH 1/2] feat(python): Add strict_trace_continuation and org_id --- .../python/configuration/options.mdx | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/platforms/python/configuration/options.mdx b/docs/platforms/python/configuration/options.mdx index 177fe3aa2e0d0..4256fc870590a 100644 --- a/docs/platforms/python/configuration/options.mdx +++ b/docs/platforms/python/configuration/options.mdx @@ -378,6 +378,29 @@ If `trace_propagation_targets` is not provided, trace data is attached to every + + +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 `org_id` 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. + + + + + +An optional 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 (if you use Relay or self-hosted), +you can provide the ID with this option. + +The organization ID is used for features like strict trace continuation. + + + 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. From aa2599e541e3b11e728f871cf5e1789c181c5b9d Mon Sep 17 00:00:00 2001 From: Neel Shah Date: Mon, 1 Dec 2025 17:08:42 +0100 Subject: [PATCH 2/2] Update docs/platforms/python/configuration/options.mdx Co-authored-by: Alex Alderman Webb --- docs/platforms/python/configuration/options.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/platforms/python/configuration/options.mdx b/docs/platforms/python/configuration/options.mdx index 4256fc870590a..9ed296b70b552 100644 --- a/docs/platforms/python/configuration/options.mdx +++ b/docs/platforms/python/configuration/options.mdx @@ -380,11 +380,12 @@ If `trace_propagation_targets` is not provided, trace data is attached to every -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. +If set to `True`, the SDK will only continue a trace if the `org_id` of the incoming trace found in the +`baggage` header matches the `org_id` of the current Sentry client and only if BOTH are present. -The client's organization ID is extracted from the DSN or can be set with the `org_id` option. +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. +The client's organization ID is extracted from the DSN or can be set with the `org_id` 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.