From c41605f4092f239fdacf10e2878ff07a495637da Mon Sep 17 00:00:00 2001 From: Matt Quinn Date: Fri, 28 Aug 2026 09:52:15 -0400 Subject: [PATCH] ref(aiohttp): Remove dead segment name code --- sentry_sdk/integrations/aiohttp.py | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/sentry_sdk/integrations/aiohttp.py b/sentry_sdk/integrations/aiohttp.py index 776d9eef0e..d882cb3805 100644 --- a/sentry_sdk/integrations/aiohttp.py +++ b/sentry_sdk/integrations/aiohttp.py @@ -21,9 +21,6 @@ from sentry_sdk.integrations.logging import ignore_logger from sentry_sdk.scope import Scope, should_send_default_pii from sentry_sdk.sessions import track_session -from sentry_sdk.traces import ( - SOURCE_FOR_STYLE as SEGMENT_SOURCE_FOR_STYLE, -) from sentry_sdk.traces import ( NoOpStreamedSpan, SegmentNameSource, @@ -339,21 +336,11 @@ async def sentry_urldispatcher_resolve( pass if name is not None: - current_span = sentry_sdk.get_current_span() - if isinstance(current_span, StreamedSpan) and not isinstance( - current_span, NoOpStreamedSpan - ): - current_span._segment.name = name - current_span._segment.set_attribute( - "sentry.segment.name.source", - SEGMENT_SOURCE_FOR_STYLE[integration.transaction_style].value, - ) - else: - current_scope = sentry_sdk.get_current_scope() - current_scope.set_transaction_name( - name, - source=SOURCE_FOR_STYLE[integration.transaction_style], - ) + current_scope = sentry_sdk.get_current_scope() + current_scope.set_transaction_name( + name, + source=SOURCE_FOR_STYLE[integration.transaction_style], + ) return rv