graphql: Attribute query cache metrics to deployments#6696
Open
DenisCarriere wants to merge 2 commits into
Open
graphql: Attribute query cache metrics to deployments#6696DenisCarriere wants to merge 2 commits into
DenisCarriere wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add bounded per-deployment cache telemetry:
query_cache_status_count{deployment,cache_status}for hit, shared-hit, insert and miss rates;query_cache_status_duration_seconds{deployment,cache_status}for comparing hit and miss latency distributions.The load manager already receives the internal deployment ID and field execution duration. This change passes the public deployment hash from both GraphQL and SQL query paths, then records cache outcome and duration using nine explicit latency buckets from 10 ms through 10 s.
Existing fleet-level counter queries can retain their current behaviour with
sum by (cache_status) (...). Series are created lazily and bounded by deployments queried by a node multiplied by the four existing cache states.Test plan
cargo fmt --all -- --checkcargo test -p graph cache_status_metrics_are_scoped_by_deploymentcargo check -p graph-graphqlThe unit test records different cache outcomes and durations for two deployments and verifies that both counters and histograms remain isolated.
Related downstream issue: pinax-network/k8s-subgraphs#471
🤖 Created by Codex GPT 5.6 SOL