Skip to content

FEATURE: Add the ability to rename metrics (TSH-20610) (copy #8412)#8424

Merged
bnjjj merged 10 commits intodevfrom
mergify/copy/dev/pr-8412
Oct 16, 2025
Merged

FEATURE: Add the ability to rename metrics (TSH-20610) (copy #8412)#8424
bnjjj merged 10 commits intodevfrom
mergify/copy/dev/pr-8412

Conversation

@mergify
Copy link
Contributor

@mergify mergify bot commented Oct 15, 2025

The need

Many Apollo customers use observability platforms (like Datadog). While OTLP semantic naming is idealistically useful for consistent metrics naming across systems, it does create practical cost management issues. Datadog, for instance, only allows tag indexing to be enabled/disabled by metric name, not by the service emitting the metric. This means customers who wish to have the ability to control the costs for tag ingestion specific by service require the need to rename Router-emitted metrics to isolate them to be able to have the necessary cost insights and controls per emanating service.

For example, for 'http.server.request.duration', the tags needed for Router monitoring can significantly differ from those for other services emitting the same metric. For one service the cardinality of a given tag may be tolerable to budget for, whereas the cardinality of the same tag by another service may not be.

Our previous federated GraphQL solution, Apollo Gateway, we prefixed all metrics with the service name, ensuring uniqueness and provided us direct control over the cost incurred by controlling the indexing on its tags isolated from other services.

The implementation

The logic added to production code is quite minimal; the bulk of this PR involves testing to ensure it works as intended and only affects customer metrics, not Apollo Studio metrics. This change uses the Rust opentelemetry crate's ability to specify instrument names via views, exposing this through a 'rename' directive in the Router config YAML.


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


This is an automatic copy of pull request #8412 done by [Mergify](https://mergify.com).

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.

@mergify mergify bot requested a review from a team October 15, 2025 15:40
@mergify mergify bot requested review from a team as code owners October 15, 2025 15:40
@apollo-cla
Copy link

@mergify[bot]: 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

apollo-librarian bot commented Oct 15, 2025

✅ 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/telemetry-pipelines/metrics-exporters/overview.mdx

Build ID: 134e9fdcabc5f6b8d306202a
Build Logs: View logs

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

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
@bnjjj bnjjj force-pushed the mergify/copy/dev/pr-8412 branch from 75cae6f to df20472 Compare October 15, 2025 15:43
@bnjjj bnjjj enabled auto-merge (squash) October 15, 2025 15:44
@bnjjj bnjjj merged commit 9828cc7 into dev Oct 16, 2025
15 checks passed
@bnjjj bnjjj deleted the mergify/copy/dev/pr-8412 branch October 16, 2025 13:24
@abernix abernix mentioned this pull request Oct 27, 2025
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.

3 participants