Skip to content

Commit 882d364

Browse files
authored
ref(wsgi): Remove unused segment name setting (#6305)
### Description In span first, there is logic in the WSGI integration that sets the segment name and the source attribute to a generic default at the end of a segment span's lifecycle, unless the name/source have been set explicitly. This logic is unnecessary. We create the segment with the default name and source, so there's no reason to rename again at the end. If the segment was renamed during its lifetime, that's the name we want to keep; the default is just a fallback. #### Issues <!-- * resolves: #1234 * resolves: LIN-1234 --> #### Reminders - Please add tests to validate your changes, and lint your code using `tox -e linters`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr)
1 parent 4f3b56a commit 882d364

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

sentry_sdk/integrations/wsgi.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -174,24 +174,6 @@ def __call__(
174174
)
175175
except BaseException:
176176
reraise(*_capture_exception())
177-
finally:
178-
if isinstance(span, StreamedSpan):
179-
already_set = (
180-
span.name != _DEFAULT_TRANSACTION_NAME
181-
and span.get_attributes().get("sentry.span.source")
182-
in [
183-
SegmentSource.COMPONENT.value,
184-
SegmentSource.ROUTE.value,
185-
SegmentSource.CUSTOM.value,
186-
]
187-
)
188-
if not already_set:
189-
with capture_internal_exceptions():
190-
span.name = _DEFAULT_TRANSACTION_NAME
191-
span.set_attribute(
192-
"sentry.span.source",
193-
SegmentSource.ROUTE.value,
194-
)
195177
finally:
196178
_wsgi_middleware_applied.set(False)
197179

0 commit comments

Comments
 (0)