Repository navigation
fix(storage): propagate client options to the gRPC metrics exporter - #16708
kalragauri wants to merge 2 commits into
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.78% 92.78% -0.01%
==========================================
Files 2271 2271
Lines 227688 228244 +556
==========================================
+ Hits 211255 211767 +512
- Misses 16433 16477 +44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
6d2ef39 to
7c45ce0
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.