feat(tonic-xds): implement OTEL metrics recorder#2704
Open
YutaoMa wants to merge 2 commits into
Open
Conversation
Provide a bundled `OtelMetricsRecorder` that adapts the gRFC A78 `MetricsRecorder` extension point onto an `opentelemetry::metrics::Meter`.
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.
Motivation
Ref: #2444
gRFC A78 defines the XdsClient OpenTelemetry metrics, and #2669 added the framework-agnostic
MetricsRecorderextension point inxds-client— but shipped no bundled backend. Every consumer therefore had to implement thetrait by hand just to get the metrics into OpenTelemetry. This PR provides that backend and exposes it through
tonic-xds.Solution
Now an
OtelMetricsRecorderis bundled whenotelfeature 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 intonic-xdsbased on the currently supported xDS features.Out of Scope
A few gaps exist as compared to A78, all because of other unsupported gRFCs:
nached_but_cachedandcache_stateare not emitted, pending A88 data-error caching.2.
grpc.xds.authorityuses#oldsentinel for now as xDS Federation is not yet supported.