Conversation
Skip Android screenshot and view hierarchy capture when their callbacks throw, while retaining the error event. Drop spans on beforeSpan failures in OkHttp, OpenFeign, GraphQL, Ktor, and Apollo without disrupting requests or replacing the original request error. Preserve normal callback results and existing catch types. Finish failed spans and retain request cleanup and breadcrumbs. Add regression coverage for callback failures, partial mutations, original request errors, asynchronous GraphQL results, and subsequent Android captures. Correct callback wiring in the Ktor and screenshot test fixtures. Verify 18 regression cases fail before the fix and pass afterward; all 454 tests in the affected suites pass, along with formatting and API checks. Refs #6081 Co-Authored-By: Claude <noreply@anthropic.com>
📲 Install BuildsAndroid
|
This was referenced Sep 25, 2026
Record callback_error/span when a throwing beforeSpan callback drops a sampled span in OkHttp, OpenFeign, GraphQL, Ktor, and Apollo. Use the pre-callback sampling decision so partial callback mutations do not hide losses, and leave unsampled spans and intentional null drops uncounted. Add regression coverage for discard notifications, sampling states, and intentional drops while preserving request and span completion behavior. Refs #6167 Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Stack (Callback Errors)
📜 Description
Guard the remaining custom capture and span callbacks covered by this change:
beforeSpanexceptions and drop the affected span without disrupting the request or replacing its original exception.Failed spans still finish, including OkHttp event-listener cleanup. Normal callback return values, intentional drops, and existing catch types remain unchanged. New guards catch
Exception; the broader catch-type sweep remains separate. No public API changes.💡 Motivation and Context
Custom filtering callbacks must not cause requests to fail or allow potentially partially processed telemetry to be sent. Android callbacks decide whether to capture an attachment, so their failure skips that capture rather than dropping the error event.
💚 How did you test it?
beforeSpancallback; the screenshot allow-capture test was setting the view-hierarchy callback../gradlew spotlessApply apiDumpandapiCheckpassed; no API files changed.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Profile/replay artifact cleanup and remaining scope/feedback callbacks are separate follow-ups. Existing
Throwablecallback-boundary handling remains deferred to the next major.