Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the PayloadMetrics class to record OpenTelemetry metrics for request and response payload body sizes in Google Cloud Storage, along with comprehensive unit tests and build file updates. The review feedback suggests simplifying the implementation and tests by directly using google::cloud::version_string() instead of defining and using a custom SemanticVersionString() helper.
| std::string SemanticVersionString() { | ||
| return std::to_string(google::cloud::version_major()) + "." + | ||
| std::to_string(google::cloud::version_minor()) + "." + | ||
| std::to_string(google::cloud::version_patch()); | ||
| } |
There was a problem hiding this comment.
| opentelemetry::nostd::shared_ptr< | ||
| opentelemetry::metrics::MeterProvider> const& provider, | ||
| std::string server_address, std::string rpc_system) | ||
| : client_version_(SemanticVersionString()), |
| std::string const expected_version = | ||
| std::to_string(google::cloud::version_major()) + "." + | ||
| std::to_string(google::cloud::version_minor()) + "." + | ||
| std::to_string(google::cloud::version_patch()); |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16712 +/- ##
==========================================
+ Coverage 92.76% 92.79% +0.02%
==========================================
Files 2273 2277 +4
Lines 227827 228136 +309
==========================================
+ Hits 211355 211692 +337
+ Misses 16472 16444 -28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Adds the internal
PayloadMetricsrecorder for the Storage OpenTelemetry payload body size histograms:gcp.storage.client.request.body.size(UInt64Histogram, unitBy)gcp.storage.client.response.body.size(UInt64Histogram, unitBy)Both histograms record logical payload byte counts (including
0-byte payloads) with the standard Storage base attributes (gcp.client.version,gcp.client.artifact,gcp.client.service,server.address) and operation attributes (rpc.system.name,gcp.storage.operation,gcp.client.method), propagating the explicitopentelemetry::context::Contextand safely no-oping when the provider, meter, or individual instruments are null.Also registers
payload_metrics.{h,cc,_test.cc}in Bazel and CMake build files.Created by cpriti-o11y-agent