Skip to content

impl(bigtable): add grpc metrics exporter - #16288

Open
scotthart wants to merge 4 commits into
googleapis:mainfrom
scotthart:bigtable_grpc_metrics_1
Open

impl(bigtable): add grpc metrics exporter#16288
scotthart wants to merge 4 commits into
googleapis:mainfrom
scotthart:bigtable_grpc_metrics_1

Conversation

@scotthart

Copy link
Copy Markdown
Member

This is the first of several PRs to add support for exporting metrics collected by the gRPC metrics plugin. The gRPC plugin is implemented as a process wide singleton, per authority, so we have to add additional logic to ensure we only create it once, even though the application may create/destroy multiple Connections/Clients during its execution.

Additional integration testing will be added in a subsequent PR.

@scotthart
scotthart requested a review from a team as a code owner July 29, 2026 18:33
@product-auto-label product-auto-label Bot added the api: bigtable Issues related to the Bigtable API. label Jul 29, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a GrpcMetricsExporter to support OpenTelemetry metrics for Bigtable gRPC clients. The implementation includes a registry to manage exporter lifetimes and deduplication, along with necessary build configuration updates. My review highlights several critical improvements: switching from std::weak_ptr to std::shared_ptr in the registry to prevent premature plugin shutdown, optimizing performance by returning const& for latency boundaries, reducing log verbosity, and adding defensive checks for variant attribute access to ensure stability.

Comment thread google/cloud/bigtable/internal/grpc_metrics_exporter.h Outdated
Comment thread google/cloud/bigtable/internal/grpc_metrics_exporter.cc Outdated
Comment thread google/cloud/bigtable/internal/grpc_metrics_exporter.cc Outdated
Comment thread google/cloud/bigtable/internal/grpc_metrics_exporter_test.cc Outdated
Comment thread google/cloud/bigtable/internal/grpc_metrics_exporter.h Outdated
Comment thread google/cloud/bigtable/internal/grpc_metrics_exporter.cc Outdated
Comment thread google/cloud/bigtable/internal/grpc_metrics_exporter.cc Outdated
Comment thread google/cloud/bigtable/internal/grpc_metrics_exporter.cc
@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.85311% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.30%. Comparing base (d799c3f) to head (b3a723f).

Files with missing lines Patch % Lines
...e/cloud/bigtable/internal/grpc_metrics_exporter.cc 70.00% 42 Missing ⚠️
...ud/bigtable/internal/grpc_metrics_exporter_test.cc 99.52% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16288      +/-   ##
==========================================
- Coverage   92.31%   92.30%   -0.01%     
==========================================
  Files        2223     2226       +3     
  Lines      208086   208440     +354     
==========================================
+ Hits       192086   192396     +310     
- Misses      16000    16044      +44     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@scotthart
scotthart marked this pull request as draft July 29, 2026 19:28
@scotthart
scotthart marked this pull request as ready for review July 29, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the Bigtable API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant