impl(bigtable): enable outstanding_rpcs metric and StubSelection event - #16362
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Bigtable client to track and export client-side metrics, specifically propagating OperationContext through the BigtableRandomTwoLeastUsed decorator and updating DynamicChannelPool to expose its TransportType. It also enhances MetricsOperationContextFactory to populate ClientResourceLabels for client-schema metrics. A critical issue was identified in operation_context_factory.cc where the monitored resource type for client-side metrics is incorrectly set to "bigtable_table" instead of "bigtable_client", which would cause Google Cloud Monitoring to reject these metrics due to label mismatches.
| google::api::MonitoredResource resource; | ||
| resource.set_type(kResourceType); |
There was a problem hiding this comment.
For client-side metrics (such as outstanding_rpcs), the monitored resource type in Google Cloud Monitoring should be "bigtable_client" rather than kResourceType (which is "bigtable_table"). Using kResourceType will cause the metrics to be rejected by the Monitoring service because the client-specific labels (like client_name, uuid, etc.) do not match the schema of the "bigtable_table" monitored resource.
google::api::MonitoredResource resource;
resource.set_type("bigtable_client");There was a problem hiding this comment.
Line 249: auto constexpr kResourceType = "bigtable_client_raw";
If anything, these lines could be factored out to the enclosing scope.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16362 +/- ##
==========================================
+ Coverage 92.23% 92.25% +0.02%
==========================================
Files 2237 2237
Lines 210251 210434 +183
==========================================
+ Hits 193928 194144 +216
+ Misses 16323 16290 -33 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
colinmoy
left a comment
There was a problem hiding this comment.
There appears to be missing test coverage in the dynamic_resource_fn block in operation_context_factory.cc
This PR wires the new outstanding_rpcs metric and associated StubSelection event into OperationContext, OperationContextFactory, the stub selection decorator, and DynamicChannelPool, enabling it to be collected and exported.