-
Notifications
You must be signed in to change notification settings - Fork 273
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
Add apollo_router_deduplicated_queries_total
metric
#6126
base: dev
Are you sure you want to change the base?
Add apollo_router_deduplicated_queries_total
metric
#6126
Conversation
❌ Docs Preview FailedError
|
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.
The hardest part will be to test it now :p
@@ -99,6 +99,9 @@ where | |||
|
|||
match receiver.recv().await { | |||
Ok(value) => { | |||
tracing::info!( | |||
monotonic_counter.apollo_router_deduplicated_queries_total = 1u64, |
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.
Could you use the new macro instead ? Search for u64_counter in the codebase. And use the new conventions with dots. Example apollo.router...
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.
@bnjjj done!
…elp me figure out how to test this properly lol
cc @BrynCooke I need you to have ideas about the name of this metric please |
Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
CI performance tests
|
} | ||
join_all(tasks).await; | ||
|
||
assert_counter!("apollo.router.deduplicated.queries", 4); |
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.
This should be apollo.router.deduplicated_queries
as the dot indicates nesting.
I do wonder if this should just be an attribute on an existing metric though. For instance:
telemetry:
instrumentation:
spans:
mode: spec_compliant
instruments:
subgraph:
http.client.request.duration:
attributes:
deduplicated: true
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.
Does making it an attribute not make it inconsistent with the existing subscriptions metric?
Add
apollo_router_deduplicated_queries_total
metric so that a platform team can understand the impact of enabling query deduplication in traffic shaping.Note: I couldn't find any examples of how to do a unit or integration test for this so I did a manual test. I setup a local router with a K6 script that hit a subgraph with an artificially slow response time. I was then able to see this metric appear in my Prometheus metrics endpoint:
Checklist
Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.
Exceptions
Note any exceptions here
Notes
Footnotes
It may be appropriate to bring upcoming changes to the attention of other (impacted) groups. Please endeavour to do this before seeking PR approval. The mechanism for doing this will vary considerably, so use your judgement as to how and when to do this. ↩
Configuration is an important part of many changes. Where applicable please try to document configuration examples. ↩
Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions. ↩