From 8ef9cd1713f9d3ff0c0bdedac506934a6dc1c87d Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Thu, 1 Oct 2026 14:11:43 +0200 Subject: [PATCH] ref: Remove SOURCE_FOR_STYLE dictionary --- sentry_sdk/integrations/litestar.py | 4 ++-- sentry_sdk/integrations/starlite.py | 4 ++-- sentry_sdk/traces.py | 13 ------------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/sentry_sdk/integrations/litestar.py b/sentry_sdk/integrations/litestar.py index 3a49983bc3..fe94b51760 100644 --- a/sentry_sdk/integrations/litestar.py +++ b/sentry_sdk/integrations/litestar.py @@ -12,7 +12,7 @@ ) from sentry_sdk.integrations.asgi import SentryAsgiMiddleware from sentry_sdk.integrations.logging import ignore_logger_for_events -from sentry_sdk.traces import SOURCE_FOR_STYLE, SegmentNameSource +from sentry_sdk.traces import SegmentNameSource from sentry_sdk.utils import ( ensure_integration_enabled, event_from_exception, @@ -265,7 +265,7 @@ async def handle_wrapper( if func is not None: name = transaction_from_function(func) - source = SOURCE_FOR_STYLE["endpoint"] + source = SegmentNameSource.COMPONENT if not name: name = _DEFAULT_TRANSACTION_NAME diff --git a/sentry_sdk/integrations/starlite.py b/sentry_sdk/integrations/starlite.py index b6cf73b6be..54e0922876 100644 --- a/sentry_sdk/integrations/starlite.py +++ b/sentry_sdk/integrations/starlite.py @@ -6,7 +6,7 @@ from sentry_sdk.data_collection import _apply_key_value_collection_filtering from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version from sentry_sdk.integrations.asgi import SentryAsgiMiddleware -from sentry_sdk.traces import SOURCE_FOR_STYLE, SegmentNameSource +from sentry_sdk.traces import SegmentNameSource from sentry_sdk.utils import ( ensure_integration_enabled, event_from_exception, @@ -240,7 +240,7 @@ async def handle_wrapper( if func is not None: name = transaction_from_function(func) - source = SOURCE_FOR_STYLE["endpoint"] + source = SegmentNameSource.COMPONENT if not name: name = _DEFAULT_TRANSACTION_NAME diff --git a/sentry_sdk/traces.py b/sentry_sdk/traces.py index 638c52f6a1..0374ccb68f 100644 --- a/sentry_sdk/traces.py +++ b/sentry_sdk/traces.py @@ -75,19 +75,6 @@ def __str__(self) -> str: ] -SOURCE_FOR_STYLE = { - "endpoint": SegmentNameSource.COMPONENT, - "function_name": SegmentNameSource.COMPONENT, - "handler_name": SegmentNameSource.COMPONENT, - "method_and_path_pattern": SegmentNameSource.ROUTE, - "path": SegmentNameSource.URL, - "route_name": SegmentNameSource.COMPONENT, - "route_pattern": SegmentNameSource.ROUTE, - "uri_template": SegmentNameSource.ROUTE, - "url": SegmentNameSource.ROUTE, -} - - # Sentinel value for an unset parent_span to be able to distinguish it from # a None set by the user _DEFAULT_PARENT_SPAN = object()