GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Isolate user callbacks, emit client reports by sentrivana · Pull Request #7692 · getsentry/sentry-python

Conversation

@sentrivana

@sentrivana sentrivana commented Sep 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

Description

Multiple user callback fixes:

  • Emit client reports with reason callback_error (docs) when telemetry is dropped because of an error in a user callback
    • This was missing for before_send, before_send_transaction, before_send_metric, before_send_log
  • Emit client reports with reason before_send if a log or a metric is explicitly dropped in before_send_metric/before_send_log by returning None
  • Isolate profiles_sampler errors in capture_internal_exceptions
  • Isolate error_processor errors in capture_internal_exceptions
  • Event and error processors used to let the event go through if an error occurred. Now they'll drop the event as per spec.

Issues

Closes https://linear.app/getsentry/issue/PY-2763/adhere-to-user-callback-error-spec

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sentrivana
fix: Isolate user callbacks, emit client reports
5084264
@linear-code

linear-code Bot commented Sep 24, 2026

Copy link
Copy Markdown

PY-2763

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry-warden[bot]
sentry-warden Bot reviewed Sep 24, 2026
View reviewed changes
Comment thread sentry_sdk/tracing.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread sentry_sdk/tracing_utils.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread tests/tracing/test_span_streaming.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Sep 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ 129936 passed | ⏭️ 7152 skipped | Total: 137088 | Pass Rate: 94.78% | Execution Time: 428m 3s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +187
Passed Tests 📈 +183
Failed Tests —
Skipped Tests 📈 +4

All tests are passing successfully.

✅ Patch coverage is 97.62%. Project has 2548 uncovered lines.
❌ Project coverage is 90.21%. Comparing base (a30e62a) to head (d22684f).

Files with missing lines (2)
File Patch % Lines
sentry_sdk/client.py 100.00% ⚠️ 4 partials
sentry_sdk/profiler/transaction_profiler.py 85.71% ⚠️ 1 Missing and 1 partials
Coverage diff
@@            Coverage Diff             @@
##        master       #PR       +/-##
==========================================
- Coverage    90.22%    90.21%    -0.01%
==========================================
  Files          194       194         —
  Lines        25997     26030       +33
  Branches      9662      9678       +16
==========================================
+ Hits         23454     23482       +28
- Misses        2543      2548        +5
- Partials      1451      1451         —

Generated by Codecov Action

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentrivana added 3 commits September 24, 2026 10:29
@sentrivana
.
c8c168a
@sentrivana
.
9be4b22
@sentrivana
.
7c784b4
sentrivana
sentrivana commented Sep 24, 2026
View reviewed changes
Comment thread sentry_sdk/integrations/aws_lambda.py
request["query_string"] = query_string

if "headers" in aws_event:
if "headers" in aws_event and isinstance(aws_event["headers"], dict):

@sentrivana sentrivana Sep 24, 2026

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This change was required because without it, the event_processor throws, and with this PR, that means the event won't be sent. Some tests were relying on the event still being sent.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sentry-warden[bot] reacted with eyes emoji
All reactions
  • 👀 1 reaction
@sentrivana
.
d22684f
@sentrivana
sentrivana marked this pull request as ready for review September 24, 2026 08:55
@sentrivana
sentrivana requested a review from a team as a code owner September 24, 2026 08:55
cursor[bot]
cursor Bot reviewed Sep 24, 2026
View reviewed changes

@cursor cursor Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this 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 d22684f. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread sentry_sdk/scope.py

for event_processor in event_processors:
new_event = event
new_event = None

@cursor cursor Bot Sep 24, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Processor errors leave Dedupe stale

Medium Severity

Event processors that throw now drop the event, but DedupeIntegration still records that exception as last-seen. A later capture of the same exception object is then discarded as a duplicate, so the error never reaches Sentry. before_send already resets Dedupe when it drops an exception event; the new processor-error path does not.

Additional Locations (1)
  • sentry_sdk/client.py#L949-L955
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d22684f. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

alexander-alderman-webb reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
alexander-alderman-webb
alexander-alderman-webb approved these changes Sep 24, 2026
View reviewed changes
@sentrivana
sentrivana enabled auto-merge (squash) September 24, 2026 09:15
@sentrivana
sentrivana merged commit a69ac4b into master Sep 24, 2026
314 of 316 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@sentrivana
sentrivana deleted the ivana/adhere-to-user-callback-spec branch September 24, 2026 09:19
@sentry-release-bot sentry-release-bot Bot mentioned this pull request Sep 28, 2026
publish: getsentry/[email protected] getsentry/publish#9684
Closed
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments
@sentry-warden sentry-warden[bot] sentry-warden[bot] left review comments
@alexander-alderman-webb alexander-alderman-webb alexander-alderman-webb approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@sentrivana @alexander-alderman-webb
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.