getsentry / getsentry/sentry-java

Align callback error handling with other SDKs

Open
#6,081 1 comment 0 reactions 0 assignees View on GitHub
Client Reports Java Platform: Java
Dominant language
Kotlin
Stars
1.4k
Forks
478
Avg merge
2d 23h
Merged PRs (30d)
67

Description

### Description

Currently Java SDK does not follow the [new spec for callbacks](https://github.com/getsentry/sentry-docs/pull/19189).
If an error happens in a customer callback (hook), the SDK should fall back according to spec.

Gaps in Java SDK:
- `beforeBreadcrumb`: on error the breadcrumb is added as is, it should be dropped instead
- `eventProcessor`: on error the event/telemetry goes further in the pipeline, it should be dropped instead

Client reports:
- there's a new discard reason `callback_error ` (https://develop.sentry.dev/sdk/telemetry/client-reports/#discard-reasons-1) which should be used to make this distinguishable from things being filtered out on purpose.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the Java SDK handling for the beforeBreadcrumb and eventProcessor callbacks, then inspect how client-report discard reasons are represented. The work is complete when callback errors drop the breadcrumb or event and record the callback_error discard reason, matching the referenced callback specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.