Skip to content

Conversation

@mbissa
Copy link
Contributor

@mbissa mbissa commented Dec 9, 2025

A79: This change introduces the API surface required to support asynchronous metrics (e.g., OpenTelemetry Observable Gauges) in gRPC-Go.

This change updates the internal MetricsRecorder interface to support registering asynchronous metric reporters. This is the second of three PRs. It establishes the contracts and wiring without adding the OpenTelemetry implementation logic. This functionality is required to support OpenTelemetry Observable Gauges, which allow components like RLS and xDS to report stateful metrics (e.g., current active requests) via callbacks.

RELEASE NOTES:

  • Defining AsyncMetricReporter and AsyncMetricsRecorder interfaces.
  • Adding RegisterAsyncReporter to the MetricsRecorder interface.
  • Implementing fan-out registration logic in MetricsRecorderList to forward callbacks to all underlying recorders.
  • Updating fake_metrics_recorder to support unit testing of async reporters.

@mbissa mbissa added this to the 1.78 Release milestone Dec 9, 2025
@mbissa mbissa self-assigned this Dec 9, 2025
@mbissa mbissa added Type: Feature New features or improvements in behavior Area: Observability Includes Stats, Tracing, Channelz, Healthz, Binlog, Reflection, Admin, GCP Observability labels Dec 9, 2025
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 34.48276% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.21%. Comparing base (f9d2bdb) to head (8547898).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
internal/stats/metrics_recorder_list.go 47.61% 10 Missing and 1 partial ⚠️
internal/testutils/stats/test_metrics_recorder.go 0.00% 4 Missing ⚠️
experimental/stats/metrics.go 0.00% 2 Missing ⚠️
stats/opentelemetry/opentelemetry.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8755      +/-   ##
==========================================
- Coverage   83.35%   83.21%   -0.15%     
==========================================
  Files         418      418              
  Lines       32377    32414      +37     
==========================================
- Hits        26989    26972      -17     
- Misses       4022     4062      +40     
- Partials     1366     1380      +14     
Files with missing lines Coverage Δ
experimental/stats/metrics.go 0.00% <0.00%> (ø)
stats/opentelemetry/opentelemetry.go 72.15% <0.00%> (-0.93%) ⬇️
internal/testutils/stats/test_metrics_recorder.go 71.62% <0.00%> (-1.99%) ⬇️
internal/stats/metrics_recorder_list.go 72.72% <47.61%> (-15.51%) ⬇️

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

A79: This change introduces the API surface required to support asynchronous metrics (e.g., OpenTelemetry Observable Gauges) in gRPC-Go.
This is the second of three PRs. It establishes the contracts and wiring without adding the OpenTelemetry implementation logic.
@mbissa mbissa force-pushed the a79-async-gauge-metrics-part2-record branch from 46948cf to 8547898 Compare December 9, 2025 07:38
@mbissa mbissa changed the title stats: define interfaces and wiring for async metric reporting stats/otel: a79 scaffolding to register an async gauge metric and api to record it- part 2 Dec 9, 2025
@mbissa mbissa requested a review from arjan-bal December 9, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Observability Includes Stats, Tracing, Channelz, Healthz, Binlog, Reflection, Admin, GCP Observability Type: Feature New features or improvements in behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants