FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ref(aiohttp): Remove dead segment name code by mjq · Pull Request #7284 · getsentry/sentry-python · GitHub

ref(aiohttp): Remove dead segment name code - #7284

Open
mjq wants to merge 1 commit into
masterfrom
mjq/aiohttp-streamedspan-branch
Open

ref(aiohttp): Remove dead segment name code#7284
mjq wants to merge 1 commit into
masterfrom
mjq/aiohttp-streamedspan-branch

Conversation

mjq commented Aug 28, 2026
edited
Loading

Copy link
Copy Markdown
Member

The aiohttp integration currently has a dead branch that looks live:

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],
)

isinstance(current_span, StreamedSpan) is always false, so the first branch never matches. sentry_sdk.get_current_span() does not return StreamedSpans. (It reads from scope.span, but the streamed span is in scope.streamed_span).

This doesn't functionally matter, because even though we always fall through to the else branch, set_transaction_name already handles the streamed span case (including the name and source). This is tested in test_transaction_style_span_streaming already.

Remove the misleading branch.

cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 985bfad. Configure here.

github-actions Bot commented Aug 28, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Codecov Results 📊

119060 passed | ⏭️ 6762 skipped | Total: 125822 | Pass Rate: 94.63% | Execution Time: 442m 34s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

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

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.29%    90.30%    +0.01%
==========================================
  Files          193       193         —
  Lines        25601     25596        -5
  Branches      9436      9434        -2
==========================================
+ Hits         23116     23113        -3
- Misses        2485      2483        -2
- Partials      1435      1434        -1

Generated by Codecov Action

mjq marked this pull request as ready for review August 28, 2026 14:21
mjq requested a review from a team as a code owner August 28, 2026 14:21
mjq marked this pull request as draft August 28, 2026 14:25
mjq force-pushed the mjq/aiohttp-streamedspan-branch branch from 985bfad to ad70524 Compare August 28, 2026 14:34
mjq changed the title fix(aiohttp): Correctly apply segment/transaction name in streaming mode ref(aiohttp): Remove dead segment name code Aug 28, 2026
mjq force-pushed the mjq/aiohttp-streamedspan-branch branch from 5ee183d to 566edcf Compare August 28, 2026 14:39
mjq marked this pull request as ready for review August 28, 2026 14:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to 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.

1 participant


Back | FazBrowse Home | New Git URL