-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Sentry Browser - Better Graphql support #13215
Comments
Hello, thanks for writing in. What are you using to interact with graphql on the frontend? Is it instrumented by sentry? If you instrument your backend with Sentry you should be getting query spans via our graphql instrumentation. |
hey @andreiborza
we have sentry installed on FE and on BE now, but not sure we did anything except standard setup there |
Could you please provide a reproduction repo or stackblitz so we can look into it? As for the description of the transaction, that's correct but you should be able to see query spans as children to this transaction. |
Please provide the link that that event, it would help investigating this. Only Sentry staff will be able to view the event. |
Although we do have GraphQL client integrations specced out in our sdk docs, we don't currently have frontend integrations for GraphQL clients in the SDK that can take care of mutating spans and similar. I assume this is for Apollo client support? Or are you looking at changing names for others? |
Also, another thing I noticed, could it be that you have not configured Sentry.init({
// continue traces to these external URLs
tracePropagationTargets: ['my-api-page.com/api']
}) |
@andreiborza @mydea interesting. yeah, we didnt specify |
@AbhiPrasad we dont use apollo atm, just |
No, you just need to configure this on the frontend, the backend will automatically pick this up then! Let us know how that works - with this in place, you should be able to properly see the connected traces including the info about the query captured on the backend, at least! |
I came here looking for better graphql support as well. Mainly just interested in OperationNames at this point. I see the ios sdks got something similar a few months ago: getsentry/sentry-cocoa#3931 |
Hmm I see - that's a great pointer! I believe we could add an optional integration for this, which enhances breadcrumbs & spans accordingly, when used! Something like this: Sentry.init({
integrations: [
Sentry.graphqlClientIntegration({
endpoints: ['/graphql'],
})
]
}) I created an issue to properly track this, PRs are welcome for this feature :D #13399 |
It would be great if this works also for the react-native SDK 🤞 |
Closing this issue as a task for this has already been created: #13399 |
Problem Statement
Problem
Sentry does not really helps with GraphQL, since there is just one endpoint, it is kind of hard to understand what is going on.
Since GraphQL is not a new thing anymore, would be nice to have better support for GraphQL out of the box
Would be nice to have query/mutation name
I know there are some existing issues regarding this, but looks like they are closed and people trying to implement it themselves
Solution Brainstorm
Would be nice to have query/mutation name whenever GraphQL request is met
The text was updated successfully, but these errors were encountered: