Giter VIP home page Giter VIP logo

Comments (2)

hluisson avatar hluisson commented on July 23, 2024 3

We're running into some issues with apollo-link-error that might fit under this issue, although please let me know if you think it might be better as a standalone.

We have the following structure for our links:

ApolloLink.from([
      errorLink,
      retryLink,
      new SentryLink({...}),
      httpLink,
    ]),

The SentryLink is immediately preceding the terminating httpLink, and between it and the errorLink. This is intentional - we were hoping that the sentry link would report to sentry before the error link executes.

In our error link, we want to automatically capture network and graphql errors and report them to sentry.
We do not report to Sentry in our product code as part of a catch block after executing a mutation - it is automatically handled by the error link

The error link looks something like this:

if (errorResponse.networkError) {
        Sentry.Native.captureException(errorResponse.networkError);
      } else if (errorResponse.graphQLErrors?.length) {
        for (const err of errorResponse.graphQLErrors) {
          Sentry.Native.captureMessage(
            err.message,
            Sentry.Native.Severity.Error
          );
        }
      }

When an error occurs, the ErrorLink successfully reports to Sentry. And in the Sentry alert, we see all the breadcrumbs from apollo-link-sentry of previous graphql requests.

However, we do not actually see a breadcrumb of the request that has the error. This is super unfortunate because that's breadcrumb we want to see the most!

It seems like SentryLink will only call attachBreadcrumbToSentry after the ErrorLink has completed. Meaning that we won't see this information in the history because captureMessage is called before attachBreadcrumbToSentry

For our use case, we were hoping that attachBreadcrumbToSentry would be called in the next block and not wait until complete. However, I'm not sure if this interferes with other use cases of the library.

Let me know if this is something you think apollo-link-sentry could support!

from apollo-link-sentry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.