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 owner June 2, 2026 18:49
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 2, 2026

PY-2310

Comment thread sentry_sdk/integrations/bottle.py Outdated
Comment thread sentry_sdk/integrations/bottle.py Outdated
Comment thread sentry_sdk/integrations/bottle.py Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

Codecov Results 📊

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

📊 Comparison with Base Branch

Metric Change
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)
File Patch % Lines
sentry_sdk/integrations/bottle.py 85.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 thread sentry_sdk/integrations/bottle.py
Comment thread sentry_sdk/integrations/bottle.py Outdated
Comment thread sentry_sdk/integrations/bottle.py Outdated
Comment thread sentry_sdk/integrations/bottle.py Outdated
Copy link
Copy Markdown
Contributor

@sentrivana sentrivana left a comment

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 thread sentry_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
Member Author

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
Copy link
Copy Markdown

@cursor cursor Bot left a comment

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 Cursor Fix in Web

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

@ericapisani ericapisani merged commit 6485eee into master Jun 3, 2026
144 checks passed
@ericapisani ericapisani deleted the py-2310-migrate-bottle branch June 3, 2026 14:15
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.

Migrate bottle to span first

2 participants