Skip to content

Commit 566edcf

Browse files
committed
fix(aiohttp): Correctly apply transaction/segment name
1 parent 8e6d73b commit 566edcf

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

sentry_sdk/integrations/aiohttp.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@
2121
from sentry_sdk.integrations.logging import ignore_logger
2222
from sentry_sdk.scope import Scope, should_send_default_pii
2323
from sentry_sdk.sessions import track_session
24-
from sentry_sdk.traces import (
25-
SOURCE_FOR_STYLE as SEGMENT_SOURCE_FOR_STYLE,
26-
)
2724
from sentry_sdk.traces import (
2825
NoOpStreamedSpan,
2926
SegmentNameSource,
@@ -339,21 +336,11 @@ async def sentry_urldispatcher_resolve(
339336
pass
340337

341338
if name is not None:
342-
current_span = sentry_sdk.get_current_span()
343-
if isinstance(current_span, StreamedSpan) and not isinstance(
344-
current_span, NoOpStreamedSpan
345-
):
346-
current_span._segment.name = name
347-
current_span._segment.set_attribute(
348-
"sentry.segment.name.source",
349-
SEGMENT_SOURCE_FOR_STYLE[integration.transaction_style].value,
350-
)
351-
else:
352-
current_scope = sentry_sdk.get_current_scope()
353-
current_scope.set_transaction_name(
354-
name,
355-
source=SOURCE_FOR_STYLE[integration.transaction_style],
356-
)
339+
current_scope = sentry_sdk.get_current_scope()
340+
current_scope.set_transaction_name(
341+
name,
342+
source=SOURCE_FOR_STYLE[integration.transaction_style],
343+
)
357344

358345
return rv
359346

0 commit comments

Comments
 (0)