-
-
Notifications
You must be signed in to change notification settings - Fork 461
Description
Problem Statement
At Dropbox we currently have http breadcrumbs that look like this:
We'd like to include our request id header in these breadcrumbs so we can trace in other systems the requests which may have failed. However, in beforeBreadcrumb, the only hook which exists to customize these, we do not have the request object to be able to pull that info, or any other info, out and place it into our breadcrumb.
We're also requesting this on iOS here: getsentry/sentry-cocoa#6540
Solution Brainstorm
Modify https://github.com/getsentry/sentry-java/blob/main/sentry-okhttp/src/main/java/io/sentry/okhttp/SentryOkHttpInterceptor.kt and add additional param of type BeforeBreadcrumbCallback which allows us to modify a breadcrumb before being sent to Sentry. This would allow us to add additional data fields to the breadcrumb such as header values from the response object.
/** The BeforeBreadcrumb callback */
public fun interface BeforeBreadcrumbCallback {
/**
* Mutates or drops a breadcrumb before being added
*
* @param breadcrumb the Breadcrumb to mutate or drop
* @param request the HTTP request executed by okHttp
* @param response the HTTP response received by okHttp
*/
public fun execute(breadcrumb: Breadcrumb, request: Request, response: Response?): Breadcrumb?
}We're open to other possible solutions too, please let us know if we're missing something or if there's a better way to do this.
Metadata
Metadata
Assignees
Labels
Projects
Status