Skip to content

Allow user to hook into Breadcrumb in SentryInstrumentation  #3413

@ooraini

Description

@ooraini

Problem Statement

I want to add more data into the breadcrumbs generated by SentryInstrumentation,. As a use case, I want to add any parameter named id when resolving any field: user(id: "..."). I could use context data, but with nesting it will not work. Example breadcrumb from sentry.io:



{
field: createXyz,
object_type: Mutation,
path: /createXyz,
type: createXyzPayload

...hook for more data

}

There are two places where breadcrumbs are used in SentryInstrumentation: beginExecuteOperation and instrumentDataFetcher. I'm not sure about beginExecuteOperation, but instrumentDataFetcher is mostly where I want to enrich the breadcrumb.

Solution Brainstorm

Nested class in SentryInstrumentation

interface DataFetcherBreadcrumbEnricher {
        void enrich(DataFetchingEnvironment environment, Breadcrumb breadcrumb);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Done

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions