Error monitoring has a nasty failure mode: the tool that tells you about problems quietly loses data because of a bug in your own code. A beforeSend callback that scrubs personal data, or a tracesSampler that picks which transactions to keep, is a small function that runs on every event. If it throws, something has to give.
Sentry Java 8.61.0 overhauled how callback errors are handled. Telemetry is dropped when a beforeSend* callback throws, and transactions are dropped when tracesSampler throws, with similar drop behaviour for spans, breadcrumbs, profiles and replays. Dropping is the safe choice for privacy, but it means a callback bug can now show up as a drop in data, not as an obvious crash.
Data Points to Track
callback_name(beforeSend, beforeSendTransaction, tracesSampler, beforeBreadcrumb)callback_exception_typeand a short message, logged to your own app logsdropped_item_type(error, transaction, span, breadcrumb, profile, replay)events_received_per_releasefrom Sentry, compared with the previous releasedropped_event_countfrom client reports, if available in your plansdk_versionto separate pre- and post-8.61.0 behaviourapp_version,device_modelandandroid_api_level, since callbacks often read thesesample_rate_effective, the share of transactions that actually arrive
Setup Steps
- List every callback you pass to
SentryOptions, including those added by libraries or wrappers. - Wrap each in your own try/catch and write failures to a local log or a separate lightweight counter, outside Sentry.
- Upgrade Sentry Java or Android to 8.61.0 or later, then to the latest release.
- Unit test the callbacks with odd inputs: null user, empty breadcrumb list, missing tags.
- Compare event volume for two or three releases around the upgrade. A sudden fall without a matching fall in sessions is a warning sign.
- Check client reports in your Sentry project for dropped items and their reasons.
- Alert on silence. Add an alert when error or transaction volume drops sharply while active users stay flat.
Actionable Insights
Begin with the ratio of events to sessions. If it falls after an upgrade, a callback is probably throwing for a specific kind of event. Look at which item type is affected first. Transactions vanishing points to tracesSampler. Missing errors point to beforeSend.
Next, split drops by device and Android version. Callbacks that read system properties often fail on older devices, so a clean result on your test phone proves little.
Finally, treat callback code like production code. It deserves tests, code review and an owner. A privacy scrubber that fails closed protects users, but a monitoring gap that lasts weeks costs you the very crashes you most need to see.
It also helps to keep one release-day checklist. After each rollout, open the project, compare event volume with the last release, and read the client reports for drop reasons. Five minutes of routine checking is far cheaper than discovering a month later that a whole class of crashes was never recorded.