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
-38Lines changed: 0 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,41 +190,3 @@ Looking to upgrade from Sentry SDK 1.x to 2.x? Here's a comprehensive list of wh
190
190
- Deprecated `sentry_sdk.transport.Transport.capture_event`. Please use `sentry_sdk.transport.Transport.capture_envelope`, instead.
191
191
- 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.
192
192
- The parameter `propagate_hub` in `ThreadingIntegration()` was deprecated and renamed to `propagate_scope`.
193
-
194
-
## Migrating Span Filtering to Span First
195
-
196
-
If you are using the experimental **Span First** mode (also known as span streaming, enabled via `_experiments={"trace_lifecycle": "stream"}`), you might notice that individual spans are sent in real-time and do not pass together through `before_send_transaction`.
197
-
198
-
To filter or ignore individual spans in Span First mode, you can use the experimental `ignore_spans` configuration option:
199
-
200
-
```python
201
-
import sentry_sdk
202
-
import re
203
-
204
-
sentry_sdk.init(
205
-
dsn="...",
206
-
traces_sample_rate=1.0, # Required for tracing
207
-
_experiments={
208
-
"trace_lifecycle": "stream",
209
-
"ignore_spans": [
210
-
"ignore_this_exact_name", # 1. Match by name (String)
211
-
re.compile(r"^GET /static/.*"), # 2. Match by name (Regex Range)
212
-
{"name": "ignore_by_name_dict"}, # 3. Match by name (Dict)
213
-
{ # 4. Match by Span Attribute
214
-
"attributes": {
215
-
"http.status_code": 200,
216
-
}
217
-
}
218
-
]
219
-
}
220
-
)
221
-
```
222
-
223
-
### Key Differences:
224
-
-**Before (Transaction Mode)**: You filtered child spans by mutating `event["spans"]` inside `before_send_transaction`.
225
-
-**After (Span First)**: You define rules up-front in `ignore_spans`. If a rule matches, a `NoOpStreamedSpan` is returned immediately resulting in no overhead.
226
-
-**Inheritance**: Any child span started with an ignored parent will automatically be ignored as well.
227
-
228
-
> [!NOTE]
229
-
> `ignore_spans` is currently an experimental feature reading from `_experiments`.
0 commit comments