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
+76-15Lines changed: 76 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,71 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
24
24
- The UnraisableHookIntegration is now enabled by default.
25
25
- We now don't suppress chained exceptions in the ASGI and asyncio integrations by default. The related `suppress_asgi_chained_exceptions` experimental option was removed.
26
26
- In the AWS Lambda and GCP integrations, the message of the warning the SDK optionally emits if a function is about to time out has changed.
27
+
- We changed the way we emit warnings. Deprecations will from now on be always emitted using `warnings.warn()`, while all other warnings will be emitted using `logger.warning()`.
28
+
-`sentry_sdk.init()` can no longer be used as a context manager.
29
+
30
+
### Logging
31
+
32
+
- The standard library logging integration is not auto-enabled by default anymore. To continue using it, add it to the `integrations` list in your `sentry_sdk.init()`:
33
+
34
+
```python
35
+
import sentry_sdk
36
+
from sentry_sdk.integrations.logging import LoggingIntegration
37
+
38
+
sentry_sdk.init(
39
+
integrations=[
40
+
LoggingIntegration(),
41
+
]
42
+
)
43
+
```
44
+
45
+
- The `level` integration option is now called `breadcrumb_level`.
46
+
- The `sentry_logs_level` integration option is now called `level`.
47
+
- The `capture_sentry_logs` option was removed. Use `level=None` to disable log capture.
48
+
- The `ignore_logger` helper was renamed to `ignore_logger_for_events`.
49
+
- The `ignore_logger_for_sentry_logs` helper was renamed to `ignore_logger`.
50
+
-`SentryHandler` was removed. Use `EventHandler` instead.
51
+
- When you enable the integration by adding `LoggingIntegration` to your `sentry_sdk.init()`, it'll start capturing Sentry logs and breadcrumbs. Creating events from logs can be enabled by providing additional integration options.
52
+
53
+
| Old name | New name | Old default | New default | Description |
54
+
| --- | --- | --- | --- | --- |
55
+
|`level`|`breadcrumb_level`|`INFO`|`INFO`| Captures logs of that level and higher as breadcrumbs. |
56
+
|`event_level`|`event_level`|`ERROR`|`None`| Captures logs of that level and higher as events. |
57
+
|`sentry_logs_level`|`level`|`INFO`|`INFO`| Captures logs of that level and higher as Sentry logs. |
58
+
|`capture_sentry_logs`| removed |`False`| n/a | Allows to opt out of instrumenting logs as Sentry logs. Use `level` (previously `sentry_logs_level`) to adjust what should be captured instead. |
59
+
|`ignore_logger`|`ignore_logger_for_events`| n/a | n/a | Loggers that match this name will not create breadcrumbs and events. |
60
+
|`unignore_logger`|`unignore_logger_for_events`| n/a | n/a | Loggers that match this name will create breadcrumbs and events again. |
61
+
|`ignore_logger_for_sentry_logs`|`ignore_logger`| n/a | n/a | Loggers that match this name will not create Sentry logs. |
62
+
|`unignore_logger_for_sentry_logs`|`unignore_logger`| n/a | n/a | Loggers that match this name will create Sentry logs again. |
63
+
64
+
65
+
### Loguru
66
+
67
+
- The Loguru logging integration is not auto-enabled by default anymore if you have Loguru installed. To continue using it, add it to the `integrations` list in your `sentry_sdk.init()`:
68
+
69
+
```python
70
+
import sentry_sdk
71
+
from sentry_sdk.integrations.loguru import LoguruIntegration
72
+
73
+
sentry_sdk.init(
74
+
integrations=[
75
+
LoguruIntegration(),
76
+
]
77
+
)
78
+
```
79
+
80
+
- The `level` integration option is now called `breadcrumb_level`.
81
+
- The `sentry_logs_level` integration option is now called `level`.
82
+
- The `capture_sentry_logs` option was removed. Use `level=None` to disable log capture.
83
+
- When you enable the integration by adding `LoguruIntegration` to your `sentry_sdk.init()`, it'll start capturing Sentry logs and breadcrumbs. Creating events from logs can be enabled by providing additional integration options.
84
+
85
+
| Old name | New name | Old default | New default | Description |
86
+
| --- | --- | --- | --- | --- |
87
+
|`level`|`breadcrumb_level`|`INFO`|`INFO`| Captures logs of that level and higher as breadcrumbs. |
88
+
|`event_level`|`event_level`|`ERROR`|`None`| Captures logs of that level and higher as events. |
89
+
|`sentry_logs_level`|`level`|`INFO`|`INFO`| Captures logs of that level and higher as Sentry logs. |
90
+
|`capture_sentry_logs`| removed |`False`| n/a | Allows to opt out of instrumenting logs as Sentry logs. Use `level` (previously `sentry_logs_level`) to adjust what should be captured instead. |
91
+
27
92
28
93
## Removed
29
94
@@ -51,21 +116,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
51
116
- Removed the RedisIntegration `max_data_size` option.
52
117
- Removed the possibility to supply a specific client to the LaunchDarklyIntegration.
53
118
- The `enable_tracing` option was removed. Use `traces_sample_rate=1.0` instead.
54
-
- The `enable_logs` option was removed. Using Sentry's logging API now works without requiring setting `enable_logs=True`. Automatic capture of logs emitted by the `logging` standard library module or Loguru can be turned on by providing the `capture_sentry_logs=True` option to either `LoggingIntegration` or `LoguruIntegration`:
55
-
56
-
```python
57
-
import sentry_sdk
58
-
from sentry_sdk.integrations.logging import LoggingIntegration
59
-
from sentry_sdk.integrations.loguru import LoguruIntegration
60
-
61
-
sentry_sdk.init(
62
-
integrations=[
63
-
LoggingIntegration(capture_sentry_logs=True),
64
-
LoguruIntegration(capture_sentry_logs=True),
65
-
]
66
-
)
67
-
```
68
-
119
+
- The `enable_logs` option was removed. Using Sentry's logging API now works without requiring setting `enable_logs=True`.
69
120
- The `enable_metrics` option was removed.
70
121
- The deprecated `@ai_track` decorator was removed.
71
122
- The deprecated `push_scope` and `configure_scope` APIs have been removed. Use `with new_scope():` to push a new scope and `scope = get_current_scope()` to retrieve the current scope instead.
@@ -87,9 +138,19 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
87
138
- The experimental `before_send_metric` option was removed. Use the top-level `before_send_metric` instead.
88
139
- The experimental `ignore_spans` option was removed. Use the top-level `ignore_spans` instead.
89
140
- The experimental `before_send_span` option was removed. Use the top-level `before_send_span` instead.
141
+
-`configure_debug_hub` was removed.
142
+
- The `max_spans` option of the `LangchainIntegration` was removed.
143
+
-`Baggage.from_options` was removed.
144
+
-`Transport.capture_event` was removed. Use `Transport.capture_envelope` instead.
145
+
- Function transports were removed.
146
+
- The `Scope.trace_propagation_meta` function no longer accepts a `span` as argument.
147
+
- Direct assignment to `Scope.level` was removed. Use `Scope.set_level` instead.
148
+
- Direct assignment to `Scope.user` was removed. Use `Scope.set_user` instead.
0 commit comments