Skip to content

feat(bottle): Add span streaming support to Bottle integration - #6486

Merged
ericapisani merged 6 commits into
masterfrom
py-2310-migrate-bottle
Jun 3, 2026
Merged

feat(bottle): Add span streaming support to Bottle integration#6486
ericapisani merged 6 commits into
masterfrom
py-2310-migrate-bottle

Conversation

@ericapisani

Copy link
Copy Markdown
Member

Add span streaming support to Bottle integration.

Fixes PY-2310
Fixes#6008

@ericapisani
ericapisani requested a review from a team as a code ownerJune 2, 2026 18:49
@linear-code

Copy link
Copy Markdown

PY-2310

Comment threadsentry_sdk/integrations/bottle.py Outdated
Comment threadsentry_sdk/integrations/bottle.py Outdated
Comment threadsentry_sdk/integrations/bottle.py Outdated
@github-actions

github-actionsBot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

88426 passed | ⏭️ 6022 skipped | Total: 94448 | Pass Rate: 93.62% | Execution Time: 294m 8s

📊 Comparison with Base Branch

MetricChange
Total Tests📈 +320
Passed Tests📈 +317
Failed Tests
Skipped Tests📈 +3

All tests are passing successfully.

✅ Patch coverage is 85.71%. Project has 2473 uncovered lines.
✅ Project coverage is 89.38%. Comparing base (base) to head (head).

Files with missing lines (1)
FilePatch %Lines
sentry_sdk/integrations/bottle.py85.71%⚠️ 2 Missing
Coverage diff
@@ Coverage Diff @@## main #PR +/-##
==========================================
+ Coverage 89.35% 89.38% +0.03%
==========================================
Files 192 192 —
Lines 23273 23285 +12
Branches 7998 8002 +4
==========================================
+ Hits 20794 20812 +18- Misses 2479 2473 -6- Partials 1309 1308 -1

Generated by Codecov Action

Comment threadsentry_sdk/integrations/bottle.py
Comment threadsentry_sdk/integrations/bottle.py Outdated
Comment threadsentry_sdk/integrations/bottle.py Outdated
Comment threadsentry_sdk/integrations/bottle.py Outdated

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

One small suggestion, but lgtm!

Comment threadsentry_sdk/integrations/bottle.py Outdated
res = old_handle(self, environ)

if has_span_streaming_enabled(sentry_sdk.get_client().options):
res = old_handle(self, environ)

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.

Looks like we can take this line out of the condition bodies since it's the same for both branches

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Good eye, will make that fix!

@ericapisani
ericapisani enabled auto-merge (squash) June 3, 2026 14:06

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

Reviewed by Cursor Bugbot for commit 5753f41. Configure here.

if has_span_streaming_enabled(sentry_sdk.get_client().options):
_set_segment_name_and_source(
transaction_style=integration.transaction_style
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Post-handle naming can fail requests

Medium Severity

After a successful old_handle, span-streaming runs _set_segment_name_and_source on the critical response path. That helper only catches RuntimeError, and the call is not wrapped in capture_internal_exceptions. Any other exception while reading bottle_request.route or calling set_transaction_name can abort the request after the handler already returned a response.

Additional Locations (1)
Fix in CursorFix in Web

Reviewed by Cursor Bugbot for commit 5753f41. Configure here.

@ericapisani
ericapisani merged commit 6485eee into masterJun 3, 2026
144 checks passed
@ericapisani
ericapisani deleted the py-2310-migrate-bottle branch June 3, 2026 14:15
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
…ntry#6486)
Add span streaming support to Bottle integration.
Fixes PY-2310
Fixesgetsentry#6008
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.

Migrate bottle to span first

2 participants

@ericapisani@sentrivana