Skip to content

feat(tonic-xds): implement OTEL metrics recorder#2704

Open
YutaoMa wants to merge 2 commits into
grpc:masterfrom
YutaoMa:yutaoma/xds-metrics
Open

feat(tonic-xds): implement OTEL metrics recorder#2704
YutaoMa wants to merge 2 commits into
grpc:masterfrom
YutaoMa:yutaoma/xds-metrics

Conversation

@YutaoMa

@YutaoMa YutaoMa commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Motivation

Ref: #2444

gRFC A78 defines the XdsClient OpenTelemetry metrics, and #2669 added the framework-agnostic MetricsRecorder extension point in xds-client — but shipped no bundled backend. Every consumer therefore had to implement the
trait by hand just to get the metrics into OpenTelemetry. This PR provides that backend and exposes it through tonic-xds.

Solution

Now an OtelMetricsRecorder is bundled when otel feature flag is enabled. User can provide their own OTEL meter and the five A78 XdsClient metrics (connected, server_failure, resource_update_valid/invalid, resources) are emitted through that meter. This PR marks the completion of metrics support in tonic-xds based on the currently supported xDS features.

Out of Scope

A few gaps exist as compared to A78, all because of other unsupported gRFCs:

  1. nached_but_cached and cache_state are not emitted, pending A88 data-error caching.
    2.grpc.xds.authority uses #old sentinel for now as xDS Federation is not yet supported.

YutaoMa added 2 commits June 25, 2026 10:57
Provide a bundled `OtelMetricsRecorder` that adapts the gRFC A78
`MetricsRecorder` extension point onto an
`opentelemetry::metrics::Meter`.
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.

1 participant