Graphql requests are not monitoring friendly
See original GitHub issueIntended outcome:
Be able to monitor graphql requests through a third party monitoring library.
Actual outcome:
Third party monitoring library override global fetch to gather data on each request.
Since createHttpLink
keep a reference to fetch (code), if global fetch is instrumented after createHttpLink
execution then graphql requests can’t be instrumented.
How to reproduce the issue:
with a simple fetch override:
const originalFetch = window.fetch;
window.fetch = function () {
console.log("request instrumented", arguments[0]);
return originalFetch.apply(this, arguments);
};
if executed before ApolloClient
initialization, graphql requests are logged
if executed after ApolloClient
initialization, graphql requests are not logged
Versions
master
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Securing Your GraphQL API from Malicious Queries
Letting this kind of query through is very bad, since it exponentially increases the amount of objects loaded and will crash your entire...
Read more >Solved: Synthetic monitor for graphql - Dynatrace Community
Hello everyone, I will create a synthetic monitor for API based on graphql. Does Dynatrace support queries and / or mutation for this...
Read more >A Guide on How to Monitor GraphQL APIs - Atatus
A GraphQL API server parses GraphQL API requests on the server-side and retrieves the appropriate data from backend services and data stores ...
Read more >Comparing REST and GraphQL Monitoring Techniques
GraphQL uses a single HTTP endpoint for all functions and allows different requests to route to the appropriate location in the GraphQL server....
Read more >Is GraphQL monitoring still hard - now that enabling tracing is ...
It was doable, but not entirely simple. Essentially we create a span on each incoming request, then retrieve that in the resolvers so...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ll get back to you once I give this one another shot. I haven’t had time to look into it closely yet.
Hi @bcaudan, thanks for your patience! Would passing the overridden
fetch
function via thefetch
option in HTTP Link per these docs address the issue you’re describing?