Skip to content

fix(bottle): Set transaction name in event processor - #7551

Merged
sentrivana merged 3 commits into
major/3.0from
ivana/major/restore-ep-transaction-name-setting
Sep 21, 2026
Merged

sentrivana merged 3 commits into
major/3.0from
ivana/major/restore-ep-transaction-name-setting

Conversation

@sentrivana

@sentrivana sentrivana commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Bottle seems to be the only web framework integration that sets the transaction name late, so errors that happen before that might not get associated to the correct segment name. We can't move the logic because we don't have enough information before that point. Restore the transaction setting logic in the event processor.

Closes https://linear.app/getsentry/issue/PY-2784/double-check-that-set-transaction-name-is-set-early-enough

@linear-code

linear-code Bot commented Sep 21, 2026

Copy link
Copy Markdown

PY-2784

@sentrivana
sentrivana marked this pull request as ready for review September 21, 2026 09:28
@sentrivana
sentrivana requested a review from a team as a code owner September 21, 2026 09:28
@github-actions

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 66085 passed | ⏭️ 2999 skipped | Total: 69084 | Pass Rate: 95.66% | Execution Time: 191m 20s

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2074 uncovered lines.
❌ Project coverage is 90.1%. Comparing base (ea0f353) to head (ebb39c1).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/integrations/bottle.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.20%    90.10%     -0.1%
==========================================
  Files          193       179       -14
  Lines        25773     20947     -4826
  Branches      9532      7530     -2002
==========================================
+ Hits         23248     18873     -4375
- Misses        2525      2074      -451
- Partials      1431      1181      -250

Generated by Codecov Action

@sentrivana
sentrivana merged commit deadc7a into major/3.0 Sep 21, 2026
145 checks passed
@sentrivana
sentrivana deleted the ivana/major/restore-ep-transaction-name-setting branch September 21, 2026 09:35

@cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ebb39c1. Configure here.

or "bottle request"
)
except RuntimeError:
return "bottle request"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing route breaks event processor

Medium Severity

_get_transaction_name only catches RuntimeError, so a bound request with no route yet raises AttributeError on .rule or .name. That failure is new in the event processor and aborts it, so events from before_request hooks or unmatched routes lose request data and never receive a fallback transaction name.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit ebb39c1. Configure here.

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.

2 participants