-
Notifications
You must be signed in to change notification settings - Fork 309
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
Khanayan123/instrument apollo gateway #4102
Conversation
BenchmarksBenchmark execution time: 2024-03-06 17:56:19 Comparing candidate commit 6f88a22 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 260 metrics, 6 unstable metrics. |
8a74ee3
to
837a42b
Compare
Overall package sizeSelf size: 6.21 MB Dependency sizes
🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4102 +/- ##
==========================================
- Coverage 85.20% 84.99% -0.22%
==========================================
Files 247 247
Lines 10878 10907 +29
Branches 33 33
==========================================
+ Hits 9269 9270 +1
- Misses 1609 1637 +28 ☔ View full report in Codecov by Sentry. |
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.
We should have the composite plugins you defined all use the serviceName/operationName
operations provided by TracingPlugin for span name and service name definition.
Having a composite plugin with the same kind for each plugin makes this sort of awkward, but you can override any of the 3 plugin properties used for resolving the naming schema by supplying a different value in options (details here).
Since you're keeping the id
consistent across all composites to have the correct component
reported, you could use (for example, details are up to you though - you might use this.constructor.operation
to build it) this.serviceName({id: 'apollo-gateway-execute'})
and this.operationName({id: 'apollo-gateway-execute'})
in span starts, and define each plugin's naming schema inside web.js
under the corresponding overridden id. This would require to set type
for all these plugins to web
and kind
to server
, which doesn't sound inaccurate to me.
* instrument apollo gateway
* instrument apollo gateway
* instrument apollo gateway
What does this PR do?
Instruments @apollo/gateway versions >= 2.3.0
Motivation
Feature request
Note
Because apollo-gateway uses graphql methods, automatic instrumentation of apollo gateway also generates graphql spans, so users are advised to disable the graphql plugin when using apollo gateway