Repository navigation
fix(storage): propagate client options to the gRPC metrics exporter - #16708
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the DetectMetricsExportMode mechanism to determine whether and how to export gRPC metrics to Cloud Monitoring based on the client's endpoint, credentials, and universe domain. It also propagates client connection options (such as credentials, CA certificates, and proxy configurations) to the exporter and adds comprehensive unit tests. The review feedback recommends avoiding auto when it obscures the Options return type in enable_metrics.cc and refactoring the IsHostName helper in metrics_exporter_options.cc to use simpler range-based loops instead of nested std::all_of with lambdas to prevent heap allocation and reduce complexity.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16708 +/- ##
==========================================
+ Coverage 92.80% 92.84% +0.03%
==========================================
Files 2279 2279
Lines 229248 230109 +861
==========================================
+ Hits 212762 213635 +873
+ Misses 16486 16474 -12 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6d2ef39 to
7c45ce0
Compare
v-pratap
left a comment
There was a problem hiding this comment.
LGTM overall — the endpoint/universe-domain gating, credential inspection, docs, and unit tests are thorough and clean.
Only a few minor nits inline (direct tests in metrics_exporter_options_test.cc, avoiding a duplicate DetectMetricsExportMode() call on the enabled path, and a pre-existing CommonOptionList warning for ProxyOption).
Also looks like metrics_exporter_options.cc has a small include conflict with main to rebase.
7c45ce0 to
8a0de81
Compare
MetricsExporterConnectionOptions()now forwards the Storage client's credential, CA certificates, and proxy options to the Cloud Monitoring connection, andDetectMetricsExportMode()enables metrics export only for compatible in-universe endpoints and credentials. Standard Storage gRPC clients using metadata-server credentials in the client's universe domain keep their existing Cloud Monitoring destination and host-attributed monitored resource labels, while other credentials use the configured project with default resource labels.