Skip to content

add parser recursion and lexical token metrics#8845

Merged
abernix merged 7 commits intodevfrom
jonathan/parser-metrics-ROUTER-1518
Feb 16, 2026
Merged

add parser recursion and lexical token metrics#8845
abernix merged 7 commits intodevfrom
jonathan/parser-metrics-ROUTER-1518

Conversation

@jhrldev
Copy link
Copy Markdown
Contributor

@jhrldev jhrldev commented Jan 30, 2026

Adds two new metrics: apollo.router.operations.recursion for the number of recursion level reached, and apollo.router.operations.lexical_tokens for the number of lexical tokens in a query.


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible1
  • Documentation2 completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added3 and documented
  • Tests added and passing4
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

Exceptions

Note any exceptions here

Notes

Footnotes

  1. 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.

  2. Configuration is an important part of many changes. Where applicable please try to document configuration examples.

  3. A lot of (if not most) features benefit from built-in observability and debug-level logs. Please read this guidance on metrics best-practices.

  4. Tick whichever testing boxes are applicable. If you are adding Manual Tests, please document the manual testing (extensively) in the Exceptions.

@jhrldev jhrldev requested a review from a team January 30, 2026 18:21
@apollo-cla
Copy link
Copy Markdown

@jhrldev: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian bot commented Jan 30, 2026

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 1 changed, 0 removed
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/standard-instruments.mdx

Build ID: c7e7c301981c8ea591d909b1
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/c7e7c301981c8ea591d909b1

@github-actions

This comment has been minimized.

Comment thread apollo-router/src/spec/query/metrics.rs Outdated
Comment thread apollo-router/src/spec/query/metrics.rs Outdated
Copy link
Copy Markdown
Contributor

@carodewig carodewig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR, @jhrldev! I have some suggestions but am excited to see these metrics added.

Comment thread apollo-router/src/spec/query/metrics.rs Outdated
Comment thread apollo-router/src/spec/query/metrics.rs Outdated
Comment thread apollo-router/src/spec/query/metrics.rs Outdated
Comment thread apollo-router/src/spec/query/metrics.rs Outdated
Comment thread apollo-router/src/spec/query/metrics.rs Outdated
@jhrldev jhrldev force-pushed the jonathan/parser-metrics-ROUTER-1518 branch from 3430f1a to f9ee59a Compare February 2, 2026 18:25
@jhrldev jhrldev requested a review from carodewig February 3, 2026 14:02
@jhrldev jhrldev force-pushed the jonathan/parser-metrics-ROUTER-1518 branch from da61785 to abe6a4a Compare February 5, 2026 14:26
Copy link
Copy Markdown
Contributor

@rohan-b99 rohan-b99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks good to me, I think we just need a changeset (cargo xtask changeset create)

Copy link
Copy Markdown
Contributor

@aaronArinder aaronArinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ histograms
✅ using allow-listed ingress name (apollo.router.operations.*)
✅ low-cardinality tags on ^ ($$$)

nice work! don't forget the changeset (if you do, no worries, it can be added after)!

Comment thread apollo-router/src/spec/query/metrics.rs
@abernix
Copy link
Copy Markdown
Member

abernix commented Feb 6, 2026

@jhrldev I would recommend doing the changeset inside the PR. it makes backporting/cherry-picking easier if there is a single commit / no follow-up PR. My suggestion is to write an initial message and then apply our style guide edits to it using Claude/Copilot/Glean, and commit that within the context of this PR.

@jhrldev jhrldev requested a review from a team as a code owner February 6, 2026 20:01
@jhrldev jhrldev force-pushed the jonathan/parser-metrics-ROUTER-1518 branch from 4b68aae to 6965b8a Compare February 6, 2026 20:07
Copy link
Copy Markdown
Contributor

@carodewig carodewig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add these metrics to the docs as well (probably docs/source/routing/observability/router-telemetry-otel/enabling-telemetry/standard-instruments.mdx)

@jhrldev jhrldev requested a review from a team as a code owner February 13, 2026 14:08
@jhrldev jhrldev force-pushed the jonathan/parser-metrics-ROUTER-1518 branch from ebe4134 to 405d4e9 Compare February 13, 2026 14:09
@jhrldev jhrldev force-pushed the jonathan/parser-metrics-ROUTER-1518 branch from 405d4e9 to b529854 Compare February 13, 2026 14:37
@abernix abernix requested a review from carodewig February 13, 2026 16:25
Copy link
Copy Markdown
Contributor

@pragl pragl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs LGTM!

Copy link
Copy Markdown
Member

@abernix abernix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't get docs review in time, we can admin overide through given the simplicity of the addition.

Ha. @pragl is too fast.

@abernix abernix dismissed carodewig’s stale review February 16, 2026 11:56

dismissing stale request

@abernix abernix enabled auto-merge (squash) February 16, 2026 11:56
@abernix abernix merged commit 05e91bf into dev Feb 16, 2026
16 checks passed
@abernix abernix deleted the jonathan/parser-metrics-ROUTER-1518 branch February 16, 2026 12:14
@abernix abernix mentioned this pull request Feb 24, 2026
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.

7 participants