Skip to content

ref(wsgi): Remove unused segment name setting - #6305

Merged
sentrivana merged 3 commits into
masterfrom
ivana/remove-post-segment-name-setting-in-wsgi
May 20, 2026
Merged

ref(wsgi): Remove unused segment name setting#6305
sentrivana merged 3 commits into
masterfrom
ivana/remove-post-segment-name-setting-in-wsgi

Conversation

@sentrivana

@sentrivanasentrivana commented May 20, 2026

Copy link
Copy Markdown
Contributor

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

Reminders

@github-actions

github-actionsBot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

282 passed | Total: 282 | Pass Rate: 100% | Execution Time: 43.59s

📊 Comparison with Base Branch

MetricChange
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 14885 uncovered lines.
✅ Project coverage is 33.43%. Comparing base (base) to head (head).

Files with missing lines (1)
FilePatch %Lines
wsgi.py18.33%⚠️ 147 Missing
Coverage diff
@@ Coverage Diff @@## main #PR +/-##
==========================================
+ Coverage 33.42% 33.43% +0.01%
==========================================
Files 190 190 —
Lines 22366 22360 -6
Branches 7594 7588 -6
==========================================
+ Hits 7475 7475 —- Misses 14891 14885 -6- Partials 744 744 —

Generated by Codecov Action

@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

5 passed | Total: 5 | Pass Rate: 100% | Execution Time: 810ms

📊 Comparison with Base Branch

MetricChange
Total Tests📉 -2
Passed Tests📉 -2
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 17191 uncovered lines.
❌ Project coverage is 23.12%. Comparing base (base) to head (head).

Files with missing lines (1)
FilePatch %Lines
wsgi.py18.33%⚠️ 147 Missing
Coverage diff
@@ Coverage Diff @@## main #PR +/-##
==========================================
- Coverage 23.32% 23.12% -0.2%
==========================================
Files 190 190 —
Lines 22366 22360 -6
Branches 7594 7588 -6
==========================================
+ Hits 5216 5169 -47- Misses 17150 17191 +41- Partials 479 476 -3

Generated by Codecov Action

@sentrivana
sentrivana marked this pull request as ready for review May 20, 2026 11:57
@sentrivana
sentrivana requested a review from a team as a code ownerMay 20, 2026 11:57
@sentrivana
sentrivana marked this pull request as draft May 20, 2026 11:58
@sentrivanasentrivana changed the title ref: Remove unused segment name settingref(wsgi): Remove unused segment name settingMay 20, 2026
@sentrivana
sentrivana marked this pull request as ready for review May 20, 2026 11:59

@alexander-alderman-webbalexander-alderman-webb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect makes the Django migration simpler 🙏
I'll wait to merge mine after this is in

@sentrivana
sentrivana enabled auto-merge (squash) May 20, 2026 12:04
@sentrivana
sentrivana merged commit 882d364 into masterMay 20, 2026
156 checks passed
@sentrivana
sentrivana deleted the ivana/remove-post-segment-name-setting-in-wsgi branch May 20, 2026 12:13
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
### 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: getsentry#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)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@sentrivana@alexander-alderman-webb