feat(storage): add stream open latency metrics and trace annotations - #16316
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces OpenTelemetry metrics and tracing to track network handshake, server metadata, and end-to-end stream open latencies in OpenObject. The review feedback highlights several critical issues regarding conditional compilation: using an invalid OpenTelemetry API call instead of the SDK's internal CurrentSpan() function, and unconditionally declaring/assigning time-tracking variables (t0_, t1_, t2_, and t3) which introduces unnecessary overhead and triggers compiler warnings when metrics are disabled. Wrapping these variables and assignments in the appropriate preprocessor guards is recommended.
99f81ee to
73bfe50
Compare
3bf2f94 to
b03de2f
Compare
b03de2f to
68e2792
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces latency metrics and tracing span events for asynchronous open object operations by adding the OpenObjectMetrics class and integrating it into OpenObject. The review feedback correctly identifies that tracing span events are currently tightly coupled with the metrics compilation flag (GOOGLE_CLOUD_CPP_STORAGE_WITH_OTEL_METRICS). To ensure tracing works independently of metrics, the reviewer suggests decoupling the timestamp tracking and span event recording so they are active when either tracing (GOOGLE_CLOUD_CPP_HAVE_OPENTELEMETRY) or metrics is enabled.
This PR captures microsecond timestamps across connection establishment, request dispatch, and metadata response receipt, exporting them to OpenTelemetry histograms and adding trace span event annotations. Follow-up PRs will add metrics for other required paths.