Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional graphqlClientIntegration to @sentry/browser #13399

Open
mydea opened this issue Aug 16, 2024 · 1 comment · May be fixed by #13783
Open

Add optional graphqlClientIntegration to @sentry/browser #13399

mydea opened this issue Aug 16, 2024 · 1 comment · May be fixed by #13783
Labels
Meta: Help Wanted Package: browser Issues related to the Sentry Browser SDK

Comments

@mydea
Copy link
Member

mydea commented Aug 16, 2024

Description

Similar to getsentry/sentry-cocoa#3931, we can add a pluggable (=not enabled by default) integration to @sentry/browser (and downstream SDKs) which allows to opt-in to get better breadcrumbs & spans when using GraphQL as a client.

This could behave like this:

Sentry.init({
  integrations: [
    Sentry.graphqlClientIntegration({
      endpoints: ['/graphql'],  
    })
  ]
})

Where any http.client span or breadcrumb created that matches endpoints will be enhanced with graphql data from the request payload:

  1. For http.client spans, we can update the span name similar to what we do here in node: feat(node): Add useOperationNameForRootSpan tographqlIntegration #13248
  2. For breadcrumbs, we can add the operation name to the breadcrumb data (and possibly also the query itself)

related: #13215

@andreiborza
Copy link
Member

Leaving this here for future reference: #13215 (comment)

@Zen-cronic Zen-cronic linked a pull request Sep 25, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta: Help Wanted Package: browser Issues related to the Sentry Browser SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants