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

Custom should_trace predicate in opentracing extensions #1066

Conversation

studzien
Copy link

Hey 👋

This is my take on #859.

At Whatnot, we are facing a similar problem to the one described, where we have a few resolvers implemented on some custom types.
The penalty for tracing every single resolver, especially on a long list, is very significant, and we're hoping to reduce response times by not generating spans for some of them.

@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Merging #1066 (0e086f0) into master (a9f0427) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1066      +/-   ##
==========================================
+ Coverage   98.11%   98.12%   +0.01%     
==========================================
  Files         115      115              
  Lines        7377     7421      +44     
==========================================
+ Hits         7238     7282      +44     
  Misses        139      139              
Impacted Files Coverage Δ
ariadne/contrib/tracing/opentracing.py 96.00% <100.00%> (+0.21%) ⬆️
tests/tracing/test_opentracing.py 100.00% <100.00%> (ø)
tests/tracing/test_opentracing_sync.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@rafalp rafalp added the decision needed Sounds like good idea, but will need closer scrutiny for final decision. label Apr 4, 2023
@rafalp
Copy link
Collaborator

rafalp commented Apr 4, 2023

Thanks for opening a PR. I'll flag this with decision needed because I would like to explore some ideas for faster middlewares first before committing to this option.

@rafalp rafalp self-requested a review April 19, 2023 11:56
@rafalp rafalp added this to the Next release milestone Apr 19, 2023
@rafalp rafalp removed the decision needed Sounds like good idea, but will need closer scrutiny for final decision. label Jun 20, 2023
@rafalp
Copy link
Collaborator

rafalp commented Jun 20, 2023

The penalty for tracing every single resolver, especially on a long list, is very significant, and we're hoping to reduce response times by not generating spans for some of them.

Most of penalty for tracing comes from asynchronous middleware making all field resolutions in graphql query executor asynchronous. async/await overhead is non-negligible when there are thousands of resolver calls.

But you may have some noise resolvers you may want to exclude from tracing anyway, so we could support that. However we are deprecating opentracing because the standard was declared deprecated and superseded by opentelemetry, for which we will be adding an extension in next Ariadne release.

@rafalp rafalp modified the milestones: 0.20, Next release Jun 21, 2023
@rafalp
Copy link
Collaborator

rafalp commented Jul 21, 2023

Closing this for lack of activity. @studzien if you want to update this PR to work for both OpenTracing and OpenTelemetry, please let me know here and I'll reopen this 😄

@rafalp rafalp closed this Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants