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
+19-16Lines changed: 19 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,8 @@ 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.
27
29
28
30
### Logging
29
31
@@ -43,7 +45,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
43
45
- The `level` integration option is now called `breadcrumb_level`.
44
46
- The `sentry_logs_level` integration option is now called `level`.
45
47
- The `capture_sentry_logs` option was removed. Use `level=None` to disable log capture.
46
-
- The `ignore_logger` helper was renamed to `ignore_logger_for_breadcrumbs_and_events`.
48
+
- The `ignore_logger` helper was renamed to `ignore_logger_for_events`.
47
49
- The `ignore_logger_for_sentry_logs` helper was renamed to `ignore_logger`.
48
50
-`SentryHandler` was removed. Use `EventHandler` instead.
49
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.
@@ -114,21 +116,7 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
114
116
- Removed the RedisIntegration `max_data_size` option.
115
117
- Removed the possibility to supply a specific client to the LaunchDarklyIntegration.
116
118
- The `enable_tracing` option was removed. Use `traces_sample_rate=1.0` instead.
117
-
- 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`:
118
-
119
-
```python
120
-
import sentry_sdk
121
-
from sentry_sdk.integrations.logging import LoggingIntegration
122
-
from sentry_sdk.integrations.loguru import LoguruIntegration
123
-
124
-
sentry_sdk.init(
125
-
integrations=[
126
-
LoggingIntegration(capture_sentry_logs=True),
127
-
LoguruIntegration(capture_sentry_logs=True),
128
-
]
129
-
)
130
-
```
131
-
119
+
- The `enable_logs` option was removed. Using Sentry's logging API now works without requiring setting `enable_logs=True`.
132
120
- The `enable_metrics` option was removed.
133
121
- The deprecated `@ai_track` decorator was removed.
134
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.
@@ -145,9 +133,24 @@ Looking to upgrade from Sentry SDK 2.x to 3.x? Here's a comprehensive list of wh
145
133
- The deprecated `propagate_traces` option has been removed. Use `trace_propagation_targets` instead, which gives you more power over trace propagation. Note that only the top-level `init` option was removed; the `propagate_traces` option of the Celery integration remains available.
146
134
- Removed Spotlight integration for Django. See [Spotlight 2.0](https://github.com/getsentry/spotlight/issues/891) for more context.
147
135
- The deprecated parameter `propagate_hub` in `ThreadingIntegration()` was removed.
136
+
- The experimental `max_spans` option was removed.
137
+
- The experimental `before_send_log` option was removed. Use the top-level `before_send_log` instead.
138
+
- The experimental `before_send_metric` option was removed. Use the top-level `before_send_metric` instead.
139
+
- The experimental `ignore_spans` option was removed. Use the top-level `ignore_spans` instead.
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