-
Notifications
You must be signed in to change notification settings - Fork 531
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
feat(instrumentation-graphql): add option to ignore resolver spans #1858
feat(instrumentation-graphql): add option to ignore resolver spans #1858
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1858 +/- ##
==========================================
- Coverage 91.50% 91.47% -0.03%
==========================================
Files 145 145
Lines 7425 7414 -11
Branches 1484 1486 +2
==========================================
- Hits 6794 6782 -12
- Misses 631 632 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good change, thank you for taking care of this. 👍
Given that there's cases where performance is impacted this much, I think it would be reasonable to make ignoreResolveSpans: true
the default in a future release.
@pichlermarc Are there any additional approves this PR needs? |
@seemk, no other approvals needed. I'll merge this in. Thank you for your contribution! |
Just noticed that this PR missed the documentation update on the README. I will make a PR to add it. |
Which problem is this PR solving?
#1739
Short description of the changes
Add the option to ignore resolver spans.
Creating a span for each resolve can cause way too many spans to be created (e.g. 100k elements in the response equals at least 100k spans, most of them will be dropped). This causes huge latency increases - my test query with an in memory resolver went from 1.2s to 8-9s. With
ignoreResolveSpans: true
the response time went back to ~1.2s.For reference, the Java implementation of GraphQL instrumentation ignores resolvers by default and there isn't even a possibility to enable creating spans from resolvers.
I think ignoring resolvers should be the default behaviour in the Node.js instrumentation as well, but for backwards compatibility I set the default value to
false
in this PR. Up for discussion whether to ignore resolvers by default or not.