Skip to content

Commit ce3059b

Browse files
authored
Deprecated enable_tracing option in Python docs. (#12439)
1 parent 34fb979 commit ce3059b

File tree

7 files changed

+14
-8
lines changed

7 files changed

+14
-8
lines changed

docs/platforms/python/configuration/options.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ sentry_sdk.init(
332332

333333
<ConfigKey name="enable-tracing">
334334

335+
_Deprecated in version 2.21.0._
336+
335337
A boolean value, if true, transactions and trace data will be generated and captured. This will set the `traces-sample-rate` to the recommended default of 1.0 if `traces-sample-rate` is not defined. Note that `traces-sample-rate` and `traces-sampler` take precedence over this option.
336338

337339
</ConfigKey>
@@ -342,7 +344,7 @@ A number between 0 and 1, controlling the percentage chance a given transaction
342344

343345
If <PlatformIdentifier name="traces-sample-rate" /> is 0, this means that no new traces will be created. However, if you have another service (for example a JS frontend) that makes requests to your service that include trace information, those traces will be continued and thus transactions will be sent to Sentry.
344346

345-
If you want to disable all tracing you need to set <PlatformIdentifier name="traces-sample-rate" />`=None` or set <PlatformIdentifier name="enable-tracing" />`=False`. In this case, no new traces will be started and no incoming traces will be continued.
347+
If you want to disable all tracing you need to set <PlatformIdentifier name="traces-sample-rate" />`=None`. In this case, no new traces will be started and no incoming traces will be continued.
346348

347349
</ConfigKey>
348350

docs/platforms/python/integrations/django/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The following parts of your Django project are monitored:
9393

9494
<Alert>
9595

96-
The parameter `enable_tracing` needs to be set when initializing the Sentry SDK for performance measurements to be recorded.
96+
The parameter [traces_sample_rate](/platforms/python/configuration/options/#traces-sample-rate) needs to be set when initializing the Sentry SDK for performance measurements to be recorded.
9797

9898
</Alert>
9999

docs/platforms/python/integrations/fastapi/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The following parts of your FastAPI project are monitored:
6363

6464
<Alert>
6565

66-
The parameter `enable_tracing` needs to be set when initializing the Sentry SDK for performance measurements to be recorded.
66+
The parameter [traces_sample_rate](/platforms/python/configuration/options/#traces-sample-rate) needs to be set when initializing the Sentry SDK for performance measurements to be recorded.
6767

6868
</Alert>
6969

docs/platforms/python/integrations/starlette/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ It takes a couple of moments for the data to appear in [sentry.io](https://sentr
4545

4646
- Request data is attached to all events: **HTTP method, URL, headers, form data, JSON payloads**. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you set `send_default_pii` to `True`.
4747

48-
- If `enable_tracing` or a `traces_sample_rate` is set, then performance information is also reported, which you can see on the **Performance** page of [sentry.io](https://sentry.io).
48+
- If [traces_sample_rate](/platforms/python/configuration/options/#traces-sample-rate) is set, then performance information is also reported, which you can see on the **Performance** page of [sentry.io](https://sentry.io).
4949

5050
## Options
5151

platform-includes/configuration/config-intro/python.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ sentry_sdk.init(
88
dsn="___PUBLIC_DSN___",
99
max_breadcrumbs=50,
1010
debug=True,
11-
enable_tracing=True,
11+
# Set traces_sample_rate to 1.0 to capture 100%
12+
# of transactions for tracing.
13+
tracees_sample_rate=1.0,
1214

1315
# By default the SDK will try to use the SENTRY_RELEASE
1416
# environment variable, or infer a git commit

platform-includes/performance/opentelemetry-setup/python.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ import sentry_sdk
66

77
sentry_sdk.init(
88
dsn="___PUBLIC_DSN___",
9-
enable_tracing=True,
9+
# Set traces_sample_rate to 1.0 to capture 100%
10+
# of transactions for tracing.
11+
traces_sample_rate=1.0,
1012

11-
# set the instrumenter to use OpenTelemetry instead of Sentry
13+
# Set the instrumenter to use OpenTelemetry instead of Sentry
1214
instrumenter="otel",
1315
)
1416
```

public/_platforms/python/performance-onboarding-2-configure.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
"name": "Python",
66
"aliases": [],
77
"categories": [],
8-
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>Configuration should happen as early as possible in your application's lifecycle.</p>\n<p>Once this is done, Sentry's Python SDK captures all unhandled exceptions and transactions. Note that enable_tracing is available in Sentry Python SDK <code>version ≥ 1.16.0</code>. To enable tracing in older SDK versions (≥ 0.11.2), use <code>traces_sample_rate=1.0</code>.</p>\n<div class=\"gatsby-highlight\" data-language=\"python\"><pre class=\"language-python highlight\"><code class=\"language-python\"><span class=\"token keyword\">import</span> sentry-sdk\n\nsentry_sdk<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">:</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">enable_tracing=True,</span>\n<span class=\"token punctuation\">)</span></code></pre></div>\n<p>Learn more about tracing <a href=\"https://docs.sentry.io/platforms/python/configuration/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">sample transactions</a>.</p>"
8+
"body": "<h4 id=\"configure\" style=\"position:relative;\">Configure</h4>\n<p>Configuration should happen as early as possible in your application's lifecycle.</p>\n<p>Once this is done, Sentry's Python SDK captures all unhandled exceptions and transactions. </p>\n<div class=\"gatsby-highlight\" data-language=\"python\"><pre class=\"language-python highlight\"><code class=\"language-python\"><span class=\"token keyword\">import</span> sentry-sdk\n\nsentry_sdk<span class=\"token punctuation\">.</span><span class=\"token function\">init</span><span class=\"token punctuation\">(</span>\n <span class=\"token literal-property property\">dsn</span><span class=\"token operator\">:</span> <span class=\"token string\">\"___PUBLIC_DSN___\"</span><span class=\"token punctuation\">,</span>\n <span class=\"token literal-property property\">traces_sample_rate=1.0,</span>\n<span class=\"token punctuation\">)</span></code></pre></div>\n<p>Learn more about tracing <a href=\"https://docs.sentry.io/platforms/python/configuration/options/#tracing-options\">options,</a> how to use the <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">traces_sampler</a> function, or how to <a href=\"https://docs.sentry.io/platforms/python/configuration/sampling/\">sample transactions</a>.</p>"
99
}

0 commit comments

Comments
 (0)