Skip to content

feat(storage): add stream open latency metrics and trace annotations - #16316

Open
kalragauri wants to merge 2 commits into
googleapis:feat/storage-experimental-metricsfrom
kalragauri:feat/storage-experimental-metrics
Open

feat(storage): add stream open latency metrics and trace annotations#16316
kalragauri wants to merge 2 commits into
googleapis:feat/storage-experimental-metricsfrom
kalragauri:feat/storage-experimental-metrics

Conversation

@kalragauri

Copy link
Copy Markdown
Contributor

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.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Aug 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread google/cloud/storage/internal/async/open_object.cc
Comment thread google/cloud/storage/internal/async/open_object.cc Outdated
Comment thread google/cloud/storage/internal/async/open_object.cc
Comment thread google/cloud/storage/internal/async/open_object.cc
Comment thread google/cloud/storage/internal/async/open_object.h
@kalragauri
kalragauri force-pushed the feat/storage-experimental-metrics branch from 99f81ee to 73bfe50 Compare August 4, 2026 11:33
@kalragauri
kalragauri marked this pull request as ready for review August 4, 2026 11:44
@kalragauri
kalragauri requested review from a team as code owners August 4, 2026 11:44
@kalragauri
kalragauri requested a review from v-pratap August 4, 2026 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant