Skip to content

Commit 8c0ea16

Browse files
fix(asyncpg): add db.driver to connect span and cleanup docs
1 parent cd81890 commit 8c0ea16

2 files changed

Lines changed: 1 addition & 38 deletions

File tree

MIGRATION_GUIDE.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -190,41 +190,3 @@ Looking to upgrade from Sentry SDK 1.x to 2.x? Here's a comprehensive list of wh
190190
- Deprecated `sentry_sdk.transport.Transport.capture_event`. Please use `sentry_sdk.transport.Transport.capture_envelope`, instead.
191191
- 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.
192192
- 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`.
230-

sentry_sdk/integrations/asyncpg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ async def _inner(*args: "Any", **kwargs: "Any") -> "T":
169169
origin=AsyncPGIntegration.origin,
170170
) as span:
171171
span.set_data(SPANDATA.DB_SYSTEM, "postgresql")
172+
span.set_data("db.driver", "asyncpg")
172173
addr = kwargs.get("addr")
173174
if addr:
174175
try:

0 commit comments

Comments
 (0)