|
1 | 1 | # Changelog
|
2 | 2 |
|
3 |
| -## 2.0.0rc6 |
| 3 | +## 2.0.0 |
4 | 4 |
|
5 |
| -### Various fixes & improvements |
6 |
| - |
7 |
| -- Restore original behavior by always creating a span (#3005) by @antonpirker |
8 |
| -- Merge baggage headers (incoming and new created ones) (#3001) by @antonpirker |
9 |
| -- Fix duplicate baggage headers in Celery integration introduced in SDK 2.0 (#2993) by @antonpirker |
10 |
| -- Make it work with old and new newrelic versions (#2999) by @antonpirker |
11 |
| -- docs: Update migration guide wording (#2987) by @colin-sentry |
12 |
| -- docs: Tweak migration guide (#2979) by @colin-sentry |
13 |
| -- Small updates to migration guide (#2911) by @colin-sentry |
14 |
| -- Update CHANGELOG.md (51a906c1) by @sentrivana |
15 |
| -- release: 1.45.0 (7570e39a) by @getsentry-bot |
16 |
| - |
17 |
| -## 2.0.0rc5 |
18 |
| - |
19 |
| -## New Features |
20 |
| - |
21 |
| -- Additional integrations will now be activated automatically if the SDK detects the respective package is installed: Ariadne, ARQ, asyncpg, Chalice, clickhouse-driver, GQL, Graphene, huey, Loguru, PyMongo, Quart, Starlite, Strawberry. |
22 |
| -- Added new API for custom instrumentation: `new_scope`, `isolation_scope`. See the [Deprecated](#deprecated) section to see how they map to the existing APIs. |
23 |
| - |
24 |
| -## Changed |
25 |
| - |
26 |
| -- The Pyramid integration will not capture errors that might happen in `authenticated_userid()` in a custom `AuthenticationPolicy` class. |
27 |
| -- The method `need_code_loation` of the `MetricsAggregator` was renamed to `need_code_location`. |
28 |
| -- The `BackgroundWorker` thread used to process events was renamed from `raven-sentry.BackgroundWorker` to `sentry-sdk.BackgroundWorker`. |
29 |
| -- The `reraise` function was moved from `sentry_sdk._compat` to `sentry_sdk.utils`. |
30 |
| -- The `_ScopeManager` was moved from `sentry_sdk.hub` to `sentry_sdk.scope`. |
31 |
| -- Moved the contents of `tracing_utils_py3.py` to `tracing_utils.py`. The `start_child_span_decorator` is now in `sentry_sdk.tracing_utils`. |
32 |
| -- The actual implementation of `get_current_span` was moved to `sentry_sdk.tracing_utils`. `sentry_sdk.get_current_span` is still accessible as part of the top-level API. |
33 |
| -- `sentry_sdk.tracing_utils.add_query_source()`: Removed the `hub` parameter. It is not necessary anymore. |
34 |
| -- `sentry_sdk.tracing_utils.record_sql_queries()`: Removed the `hub` parameter. It is not necessary anymore. |
35 |
| -- `sentry_sdk.tracing_utils.get_current_span()` does now take a `scope` instead of a `hub` as parameter. |
36 |
| -- `sentry_sdk.tracing_utils.should_propagate_trace()` now takes a `Client` instead of a `Hub` as first parameter. |
37 |
| -- `sentry_sdk.utils.is_sentry_url()` now takes a `Client` instead of a `Hub` as first parameter. |
38 |
| -- `sentry_sdk.utils._get_contextvars` does not return a tuple with three values, but a tuple with two values. The `copy_context` was removed. |
39 |
| -- If you create a transaction manually and later mutate the transaction in a `configure_scope` block this does not work anymore. Here is a recipe on how to change your code to make it work: |
40 |
| - Your existing implementation: |
41 |
| - ```python |
42 |
| - transaction = sentry_sdk.transaction(...) |
43 |
| - |
44 |
| - # later in the code execution: |
45 |
| - |
46 |
| - with sentry_sdk.configure_scope() as scope: |
47 |
| - scope.set_transaction_name("new-transaction-name") |
48 |
| - ``` |
49 |
| - |
50 |
| - needs to be changed to this: |
51 |
| - ```python |
52 |
| - transaction = sentry_sdk.transaction(...) |
53 |
| - |
54 |
| - # later in the code execution: |
55 |
| - |
56 |
| - scope = sentry_sdk.Scope.get_current_scope() |
57 |
| - scope.set_transaction_name("new-transaction-name") |
58 |
| - ``` |
59 |
| -- The classes listed in the table below are now abstract base classes. Therefore, they can no longer be instantiated. Subclasses can only be instantiated if they implement all of the abstract methods. |
60 |
| - <details> |
61 |
| - <summary><b>Show table</b></summary> |
62 |
| - |
63 |
| - | Class | Abstract methods | |
64 |
| - | ------------------------------------- | -------------------------------------- | |
65 |
| - | `sentry_sdk.integrations.Integration` | `setup_once` | |
66 |
| - | `sentry_sdk.metrics.Metric` | `add`, `serialize_value`, and `weight` | |
67 |
| - | `sentry_sdk.profiler.Scheduler` | `setup` and `teardown` | |
68 |
| - | `sentry_sdk.transport.Transport` | `capture_envelope` | |
69 |
| - |
70 |
| - </details> |
71 |
| - |
72 |
| -## Removed |
73 |
| - |
74 |
| -- Removed support for Python 2 and Python 3.5. The SDK now requires at least Python 3.6. |
75 |
| -- Removed support for Celery 3.\*. |
76 |
| -- Removed support for Django 1.8, 1.9, 1.10. |
77 |
| -- Removed support for Flask 0.\*. |
78 |
| -- Removed support for gRPC < 1.39. |
79 |
| -- Removed support for Tornado < 6. |
80 |
| -- Removed `last_event_id()` top level API. The last event ID is still returned by `capture_event()`, `capture_exception()` and `capture_message()` but the top level API `sentry_sdk.last_event_id()` has been removed. |
81 |
| -- Removed support for sending events to the `/store` endpoint. Everything is now sent to the `/envelope` endpoint. If you're on SaaS you don't have to worry about this, but if you're running Sentry yourself you'll need version `20.6.0` or higher of self-hosted Sentry. |
82 |
| -- The deprecated `with_locals` configuration option was removed. Use `include_local_variables` instead. See https://docs.sentry.io/platforms/python/configuration/options/#include-local-variables. |
83 |
| -- The deprecated `request_bodies` configuration option was removed. Use `max_request_body_size`. See https://docs.sentry.io/platforms/python/configuration/options/#max-request-body-size. |
84 |
| -- Removed support for `user.segment`. It was also removed from the trace header as well as from the dynamic sampling context. |
85 |
| -- Removed support for the `install` method for custom integrations. Please use `setup_once` instead. |
86 |
| -- Removed `sentry_sdk.tracing.Span.new_span`. Use `sentry_sdk.tracing.Span.start_child` instead. |
87 |
| -- Removed `sentry_sdk.tracing.Transaction.new_span`. Use `sentry_sdk.tracing.Transaction.start_child` instead. |
88 |
| -- Removed support for creating transactions via `sentry_sdk.tracing.Span(transaction=...)`. To create a transaction, please use `sentry_sdk.tracing.Transaction(name=...)`. |
89 |
| -- Removed `sentry_sdk.utils.Auth.store_api_url`. |
90 |
| -- `sentry_sdk.utils.Auth.get_api_url`'s now accepts a `sentry_sdk.consts.EndpointType` enum instead of a string as its only parameter. We recommend omitting this argument when calling the function, since the parameter's default value is the only possible `sentry_sdk.consts.EndpointType` value. The parameter exists for future compatibility. |
91 |
| -- Removed `tracing_utils_py2.py`. The `start_child_span_decorator` is now in `sentry_sdk.tracing_utils`. |
92 |
| -- Removed the `sentry_sdk.profiler.Scheduler.stop_profiling` method. Any calls to this method can simply be removed, since this was a no-op method. |
93 |
| - |
94 |
| -## Deprecated |
95 |
| - |
96 |
| -- Using the `Hub` directly as well as using hub-based APIs has been deprecated. Where available, use [the top-level API instead](sentry_sdk/api.py); otherwise use the [scope API](sentry_sdk/scope.py) or the [client API](sentry_sdk/client.py). |
97 |
| - |
98 |
| - Before: |
99 |
| - |
100 |
| - ```python |
101 |
| - with hub.start_span(...): |
102 |
| - # do something |
103 |
| - ``` |
104 |
| - |
105 |
| - After: |
106 |
| - |
107 |
| - ```python |
108 |
| - import sentry_sdk |
109 |
| - |
110 |
| - with sentry_sdk.start_span(...): |
111 |
| - # do something |
112 |
| - ``` |
113 |
| - |
114 |
| -- Hub cloning is deprecated. |
115 |
| - |
116 |
| - Before: |
117 |
| - |
118 |
| - ```python |
119 |
| - with Hub(Hub.current) as hub: |
120 |
| - # do something with the cloned hub |
121 |
| - ``` |
122 |
| - |
123 |
| - After: |
124 |
| - |
125 |
| - ```python |
126 |
| - import sentry_sdk |
127 |
| - |
128 |
| - with sentry_sdk.isolation_scope() as scope: |
129 |
| - # do something with the forked scope |
130 |
| - ``` |
131 |
| - |
132 |
| -- `configure_scope` is deprecated. Use the new isolation scope directly via `Scope.get_isolation_scope()` instead. |
133 |
| - |
134 |
| - Before: |
135 |
| - |
136 |
| - ```python |
137 |
| - with configure_scope() as scope: |
138 |
| - # do something with `scope` |
139 |
| - ``` |
140 |
| - |
141 |
| - After: |
142 |
| - |
143 |
| - ```python |
144 |
| - from sentry_sdk.scope import Scope |
145 |
| - |
146 |
| - scope = Scope.get_isolation_scope() |
147 |
| - # do something with `scope` |
148 |
| - ``` |
| 5 | +This is the first major update in a *long* time! |
149 | 6 |
|
150 |
| -- `push_scope` is deprecated. Use the new `new_scope` context manager to fork the necessary scopes. |
| 7 | +We dropped support for some ancient languages and frameworks (Yes, Python 2.7 is no longer supported). Additionally we refactored a big part of the foundation of the SDK (how data inside the SDK is handled). |
151 | 8 |
|
152 |
| - Before: |
| 9 | +We hope you like it! |
153 | 10 |
|
154 |
| - ```python |
155 |
| - with push_scope() as scope: |
156 |
| - # do something with `scope` |
157 |
| - ``` |
| 11 | +For a shorter version of what you need to do, to upgrade to Sentry SDK 2.0 see: https://docs.sentry.io/platforms/python/migration/1.x-to-2.x |
158 | 12 |
|
159 |
| - After: |
160 |
| - |
161 |
| - ```python |
162 |
| - import sentry_sdk |
163 |
| - |
164 |
| - with sentry_sdk.new_scope() as scope: |
165 |
| - # do something with `scope` |
166 |
| - ``` |
167 |
| - |
168 |
| -- Accessing the client via the hub has been deprecated. Use the top-level `sentry_sdk.get_client()` to get the current client. |
169 |
| -- `profiler_mode` and `profiles_sample_rate` have been deprecated as `_experiments` options. Use them as top level options instead: |
170 |
| - ```python |
171 |
| - sentry_sdk.init( |
172 |
| - ..., |
173 |
| - profiler_mode="thread", |
174 |
| - profiles_sample_rate=1.0, |
175 |
| - ) |
176 |
| - ``` |
177 |
| -- Deprecated `sentry_sdk.transport.Transport.capture_event`. Please use `sentry_sdk.transport.Transport.capture_envelope`, instead. |
178 |
| -- Passing a function to `sentry_sdk.init`'s `transport` keyword argument has been deprecated. If you wish to provide a custom transport, please pass a `sentry_sdk.transport.Transport` instance or a subclass. |
179 |
| -- The parameter `propagate_hub` in `ThreadingIntegration()` was deprecated and renamed to `propagate_scope`. |
180 |
| - |
181 |
| -## 2.0.0rc4 |
182 |
| - |
183 |
| -## New Features |
| 13 | +### New Features |
184 | 14 |
|
185 | 15 | - Additional integrations will now be activated automatically if the SDK detects the respective package is installed: Ariadne, ARQ, asyncpg, Chalice, clickhouse-driver, GQL, Graphene, huey, Loguru, PyMongo, Quart, Starlite, Strawberry.
|
186 | 16 | - Added new API for custom instrumentation: `new_scope`, `isolation_scope`. See the [Deprecated](#deprecated) section to see how they map to the existing APIs.
|
187 | 17 |
|
188 |
| -## Changed |
| 18 | +### Changed |
| 19 | +(These changes are all backwards-incompatible. **Breaking Change** (if you are just skimming for that phrase)) |
189 | 20 |
|
190 | 21 | - The Pyramid integration will not capture errors that might happen in `authenticated_userid()` in a custom `AuthenticationPolicy` class.
|
191 | 22 | - The method `need_code_loation` of the `MetricsAggregator` was renamed to `need_code_location`.
|
|
233 | 64 |
|
234 | 65 | </details>
|
235 | 66 |
|
236 |
| -## Removed |
| 67 | +### Removed |
| 68 | +(These changes are all backwards-incompatible. **Breaking Change** (if you are just skimming for that phrase)) |
237 | 69 |
|
238 | 70 | - Removed support for Python 2 and Python 3.5. The SDK now requires at least Python 3.6.
|
239 | 71 | - Removed support for Celery 3.\*.
|
|
255 | 87 | - Removed `tracing_utils_py2.py`. The `start_child_span_decorator` is now in `sentry_sdk.tracing_utils`.
|
256 | 88 | - Removed the `sentry_sdk.profiler.Scheduler.stop_profiling` method. Any calls to this method can simply be removed, since this was a no-op method.
|
257 | 89 |
|
258 |
| -## Deprecated |
| 90 | +### Deprecated |
259 | 91 |
|
260 | 92 | - Using the `Hub` directly as well as using hub-based APIs has been deprecated. Where available, use [the top-level API instead](sentry_sdk/api.py); otherwise use the [scope API](sentry_sdk/scope.py) or the [client API](sentry_sdk/client.py).
|
261 | 93 |
|
|
342 | 174 | - Passing a function to `sentry_sdk.init`'s `transport` keyword argument has been deprecated. If you wish to provide a custom transport, please pass a `sentry_sdk.transport.Transport` instance or a subclass.
|
343 | 175 | - The parameter `propagate_hub` in `ThreadingIntegration()` was deprecated and renamed to `propagate_scope`.
|
344 | 176 |
|
345 |
| -## 2.0.0rc3 |
346 |
| - |
347 |
| -### Various fixes & improvements |
348 |
| - |
349 |
| -- Use new scopes API default integrations. (#2856) by @antonpirker |
350 |
| -- Use new scopes API in openai integration (#2853) by @antonpirker |
351 |
| -- Use new scopes API in Celery integration. (#2851) by @antonpirker |
352 |
| -- Use new scopes API in Django, SQLAlchemy, and asyncpg integration. (#2845) by @antonpirker |
353 |
| -- Use new scopes API in Redis (#2854) by @sentrivana |
354 |
| -- Use new scopes API in GQL Integration (#2838) by @szokeasaurusrex |
355 |
| -- Use new scopes API in LoggingIntegration (#2861, #2855) by @sentrivana |
356 |
| -- Use new scopes API in FastAPI integration (#2836) by @szokeasaurusrex |
357 |
| -- Use new scopes API in Ariadne (#2850) by @szokeasaurusrex |
358 |
| -- Add optional `keep_alive` (#2842) by @sentrivana |
359 |
| -- Add support for celery-redbeat cron tasks (#2643) by @kwigley |
360 |
| -- AWS Lambda: aws_event can be an empty list (#2849) by @sentrivana |
361 |
| -- GQL: Remove problematic tests (#2835) by @szokeasaurusrex |
362 |
| -- Moved `should_send_default_pii` into client (#2840) by @antonpirker |
363 |
| -- `should_send_default_pii` shortcut (#2844) by @szokeasaurusrex |
364 |
| -- Use `scope.should_send_default_pii` in FastAPI integration (#2846) by @szokeasaurusrex |
365 |
| -- Patched functions decorator for integrations (#2454) by @szokeasaurusrex |
366 |
| -- Small APIdocs improvement (#2828) by @antonpirker |
367 |
| -- Bump checkouts/data-schemas from `ed078ed` to `8232f17` (#2832) by @dependabot |
368 |
| -- Update CHANGELOG.md (970c5779) by @sentrivana |
369 |
| -- Updated migration guide (#2859) by @antonpirker |
370 |
| - |
371 |
| -_Plus 2 more_ |
372 |
| - |
373 |
| -## 2.0.0rc2 |
374 |
| - |
375 |
| -## New Features |
376 |
| - |
377 |
| -- Additional integrations will now be activated automatically if the SDK detects the respective package is installed: Ariadne, ARQ, asyncpg, Chalice, clickhouse-driver, GQL, Graphene, huey, Loguru, PyMongo, Quart, Starlite, Strawberry. |
378 |
| - |
379 |
| -## Changed |
380 |
| - |
381 |
| -- The Pyramid integration will not capture errors that might happen in `authenticated_userid()` in a custom `AuthenticationPolicy` class. |
382 |
| -- The method `need_code_loation` of the `MetricsAggregator` was renamed to `need_code_location`. |
383 |
| -- The `BackgroundWorker` thread used to process events was renamed from `raven-sentry.BackgroundWorker` to `sentry-sdk.BackgroundWorker`. |
384 |
| -- The `reraise` function was moved from `sentry_sdk._compat` to `sentry_sdk.utils`. |
385 |
| -- The `_ScopeManager` was moved from `sentry_sdk.hub` to `sentry_sdk.scope`. |
386 |
| -- Moved the contents of `tracing_utils_py3.py` to `tracing_utils.py`. The `start_child_span_decorator` is now in `sentry_sdk.tracing_utils`. |
387 |
| -- The actual implementation of `get_current_span` was moved to `sentry_sdk.tracing_utils`. `sentry_sdk.get_current_span` is still accessible as part of the top-level API. |
388 |
| -- `sentry_sdk.tracing_utils.get_current_span()` does now take a `scope` instead of a `hub` as parameter. |
389 |
| -- `sentry_sdk.utils._get_contextvars` does not return a tuple with three values, but a tuple with two values. The `copy_context` was removed. |
390 |
| -- If you create a transaction manually and later mutate the transaction in a `configure_scope` block this does not work anymore. Here is a recipe on how to change your code to make it work: |
391 |
| - Your existing implementation: |
392 |
| - ```python |
393 |
| - transaction = sentry_sdk.transaction(...) |
394 |
| - |
395 |
| - # later in the code execution: |
396 |
| - |
397 |
| - with sentry_sdk.configure_scope() as scope: |
398 |
| - scope.set_transaction_name("new-transaction-name") |
399 |
| - ``` |
400 |
| - |
401 |
| - needs to be changed to this: |
402 |
| - ```python |
403 |
| - transaction = sentry_sdk.transaction(...) |
404 |
| - |
405 |
| - # later in the code execution: |
406 |
| - |
407 |
| - scope = sentry_sdk.Scope.get_current_scope() |
408 |
| - scope.set_transaction_name("new-transaction-name") |
409 |
| - ``` |
410 |
| -- The classes listed in the table below are now abstract base classes. Therefore, they can no longer be instantiated. Subclasses can only be instantiated if they implement all of the abstract methods. |
411 |
| - <details> |
412 |
| - <summary><b>Show table</b></summary> |
413 |
| - |
414 |
| - | Class | Abstract methods | |
415 |
| - | ------------------------------------- | -------------------------------------- | |
416 |
| - | `sentry_sdk.integrations.Integration` | `setup_once` | |
417 |
| - | `sentry_sdk.metrics.Metric` | `add`, `serialize_value`, and `weight` | |
418 |
| - | `sentry_sdk.profiler.Scheduler` | `setup` and `teardown` | |
419 |
| - | `sentry_sdk.transport.Transport` | `capture_envelope` | |
420 |
| - |
421 |
| - </details> |
422 |
| - |
423 |
| -## Removed |
424 |
| - |
425 |
| -- Removed support for Python 2 and Python 3.5. The SDK now requires at least Python 3.6. |
426 |
| -- Removed support for Celery 3.\*. |
427 |
| -- Removed support for Django 1.8, 1.9, 1.10. |
428 |
| -- Removed support for Flask 0.\*. |
429 |
| -- Removed support for gRPC < 1.39. |
430 |
| -- Removed `last_event_id()` top level API. The last event ID is still returned by `capture_event()`, `capture_exception()` and `capture_message()` but the top level API `sentry_sdk.last_event_id()` has been removed. |
431 |
| -- Removed support for sending events to the `/store` endpoint. Everything is now sent to the `/envelope` endpoint. If you're on SaaS you don't have to worry about this, but if you're running Sentry yourself you'll need version `20.6.0` or higher of self-hosted Sentry. |
432 |
| -- The deprecated `with_locals` configuration option was removed. Use `include_local_variables` instead. See https://docs.sentry.io/platforms/python/configuration/options/#include-local-variables. |
433 |
| -- The deprecated `request_bodies` configuration option was removed. Use `max_request_body_size`. See https://docs.sentry.io/platforms/python/configuration/options/#max-request-body-size. |
434 |
| -- Removed support for `user.segment`. It was also removed from the trace header as well as from the dynamic sampling context. |
435 |
| -- Removed support for the `install` method for custom integrations. Please use `setup_once` instead. |
436 |
| -- Removed `sentry_sdk.tracing.Span.new_span`. Use `sentry_sdk.tracing.Span.start_child` instead. |
437 |
| -- Removed `sentry_sdk.tracing.Transaction.new_span`. Use `sentry_sdk.tracing.Transaction.start_child` instead. |
438 |
| -- Removed `sentry_sdk.utils.Auth.store_api_url`. |
439 |
| -- `sentry_sdk.utils.Auth.get_api_url`'s now accepts a `sentry_sdk.consts.EndpointType` enum instead of a string as its only parameter. We recommend omitting this argument when calling the function, since the parameter's default value is the only possible `sentry_sdk.consts.EndpointType` value. The parameter exists for future compatibility. |
440 |
| -- Removed `tracing_utils_py2.py`. The `start_child_span_decorator` is now in `sentry_sdk.tracing_utils`. |
441 |
| -- Removed the `sentry_sdk.profiler.Scheduler.stop_profiling` method. Any calls to this method can simply be removed, since this was a no-op method. |
442 |
| - |
443 |
| -## Deprecated |
444 |
| - |
445 |
| -- `profiler_mode` and `profiles_sample_rate` have been deprecated as `_experiments` options. Use them as top level options instead: |
446 |
| - ```python |
447 |
| - sentry_sdk.init( |
448 |
| - ..., |
449 |
| - profiler_mode="thread", |
450 |
| - profiles_sample_rate=1.0, |
451 |
| - ) |
452 |
| - ``` |
453 |
| -- Deprecated `sentry_sdk.transport.Transport.capture_event`. Please use `sentry_sdk.transport.Transport.capture_envelope`, instead. |
454 |
| -- Passing a function to `sentry_sdk.init`'s `transport` keyword argument has been deprecated. If you wish to provide a custom transport, please pass a `sentry_sdk.transport.Transport` instance or a subclass. |
455 |
| -- The parameter `propagate_hub` in `ThreadingIntegration()` was deprecated and renamed to `propagate_scope`. |
456 |
| - |
457 | 177 | ## 1.45.0
|
458 | 178 |
|
459 | 179 | This is the final 1.x release for the forseeable future. Development will continue on the 2.x release line. The first 2.x version will be available in the next few weeks.
|
|
0 commit comments