You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MIGRATION_GUIDE.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
9
9
### Changed
10
10
11
11
- The SDK now supports Python 3.7 and higher.
12
+
- The default of `traces_sample_rate` changed to `0`. Meaning: Incoming traces will be continued by default. For example, if your frontend sends a `sentry-trace/baggage` headers pair, your SDK will create Spans and send them to Sentry. (The default used to be `None` meaning by default no Spans where created, no matter what headers the frontend sent to your project.) See also: https://docs.sentry.io/platforms/python/configuration/options/#traces_sample_rate
12
13
-`sentry_sdk.start_span` now only takes keyword arguments.
13
14
-`sentry_sdk.start_transaction`/`sentry_sdk.start_span` no longer takes the following arguments: `span`, `parent_sampled`, `trace_id`, `span_id` or `parent_span_id`.
14
15
- You can no longer change the sampled status of a span with `span.sampled = False` after starting it.
@@ -131,7 +132,6 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
131
132
132
133
### Removed
133
134
134
-
- Spans no longer have a `description`. Use `name` instead.
135
135
- Dropped support for Python 3.6.
136
136
- The `enable_tracing``init` option has been removed. Configure `traces_sample_rate` directly.
137
137
- The `propagate_traces``init` option has been removed. Use `trace_propagation_targets` instead.
@@ -157,11 +157,15 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
157
157
-`profiles_sample_rate` and `profiler_mode` were removed from options available via `_experiments`. Use the top-level `profiles_sample_rate` and `profiler_mode` options instead.
158
158
-`Transport.capture_event` has been removed. Use `Transport.capture_envelope` instead.
159
159
- Function transports are no longer supported. Subclass the `Transport` instead.
160
+
-`start_transaction` (`start_span`) no longer takes the following arguments:
161
+
-`trace_id`, `baggage`: use `continue_trace` for propagation from headers or environment variables
162
+
-`same_process_as_parent`
163
+
-`span_id`
164
+
-`parent_span_id`: you can supply a `parent_span` instead
160
165
- Setting `Scope.transaction` directly is no longer supported. Use `Scope.set_transaction_name()` instead.
161
166
- Passing a list or `None` for `failed_request_status_codes` in the Starlette integration is no longer supported. Pass a set of integers instead.
162
167
- The `span` argument of `Scope.trace_propagation_meta` is no longer supported.
163
168
- Setting `Scope.user` directly is no longer supported. Use `Scope.set_user()` instead.
164
-
-`start_transaction` (`start_span`) no longer takes a `baggage` argument. Use the `continue_trace()` context manager instead to propagate baggage.
Copy file name to clipboardExpand all lines: tests/integrations/opentelemetry/test_sampler.py
+16-12Lines changed: 16 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,16 @@
6
6
importsentry_sdk
7
7
8
8
9
+
USE_DEFAULT_TRACES_SAMPLE_RATE=-1
10
+
9
11
tracer=trace.get_tracer(__name__)
10
12
11
13
12
14
@pytest.mark.parametrize(
13
15
"traces_sample_rate, expected_num_of_envelopes",
14
16
[
15
-
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=None will be used)
16
-
(-1, 0),
17
+
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=0 will be used)
18
+
(USE_DEFAULT_TRACES_SAMPLE_RATE, 0),
17
19
# traces_sample_rate=None means do not create new traces, and also do not continue incoming traces. So, no envelopes at all.
18
20
(None, 0),
19
21
# traces_sample_rate=0 means do not create new traces (0% of the requests), but continue incoming traces. So envelopes will be created only if there is an incoming trace.
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=None will be used)
180
-
(-1, 0),
181
+
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=0 will be used)
182
+
(USE_DEFAULT_TRACES_SAMPLE_RATE, 1),
181
183
# traces_sample_rate=None means do not create new traces, and also do not continue incoming traces. So, no envelopes at all.
182
184
(None, 0),
183
185
# traces_sample_rate=0 means do not create new traces (0% of the requests), but continue incoming traces. So envelopes will be created only if there is an incoming trace.
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=None will be used)
231
-
(-1, 0, 0),
232
+
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=0 will be used)
233
+
(USE_DEFAULT_TRACES_SAMPLE_RATE, 0, 0),
234
+
(USE_DEFAULT_TRACES_SAMPLE_RATE, 1, 1),
232
235
# traces_sample_rate=None means do not create new traces, and also do not continue incoming traces. So, no envelopes at all.
236
+
(None, 0, 0),
233
237
(None, 1, 0),
234
238
# traces_sample_rate=0 means do not create new traces (0% of the requests), but continue incoming traces. So envelopes will be created only if there is an incoming trace.
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=None will be used)
285
-
(-1, 0),
288
+
# special case for testing, do not pass any traces_sample_rate to init() (the default traces_sample_rate=0 will be used)
289
+
(USE_DEFAULT_TRACES_SAMPLE_RATE, 0),
286
290
# traces_sample_rate=None means do not create new traces, and also do not continue incoming traces. So, no envelopes at all.
287
291
(None, 0),
288
292
# traces_sample_rate=0 means do not create new traces (0% of the requests), but continue incoming traces. So envelopes will be created only if there is an incoming trace.
0 commit comments