Skip to content

Update metrics for persisted query support.#2149

Merged
srinivasankavitha merged 2 commits intomasterfrom
persisted-queries-metrics
Apr 14, 2025
Merged

Update metrics for persisted query support.#2149
srinivasankavitha merged 2 commits intomasterfrom
persisted-queries-metrics

Conversation

@srinivasankavitha
Copy link
Contributor

Pull Request type

  • Bugfix
  • Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Other (please describe):

Changes in this PR

This PR enhances our DGS metrics to track persisted query related information.

  1. Automated Persisted queries (APQ) usually involve a handshake where the client sends a hash of the query first, and on failure(due to PersistedQueryNotFound), sends a full query with the hash. Subsequent queries will then be successful. Since the first attempt will result in an error, we exclude this from the gql.error metric to avoid falsely alerting on a spike in errors.
  2. Introduced a new metric gql.persistedQueryNotFound to capture persistedQueryNotFound errors with a tag indicating the PQ id.
  3. Enhanced gql.query metric with a tag to indicate the query type - i.e. APQ, FULL_APQ, NOT_APQ. APQ is used when the query contains just a hash. FULL_APQ indicates the query has both a query and a hash (as part of the APQ handshake) and all other queries are just in the NOT_APQ category.

@srinivasankavitha srinivasankavitha merged commit eb67744 into master Apr 14, 2025
2 checks passed
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