Skip to content

feat(storage): implement high-precision microsecond telemetry for Bidi reads - #20197

Open
sahusneha2004 wants to merge 1 commit into
googleapis:mainfrom
sahusneha2004:feature/bidi-rapid-metrics
Open

feat(storage): implement high-precision microsecond telemetry for Bidi reads#20197
sahusneha2004 wants to merge 1 commit into
googleapis:mainfrom
sahusneha2004:feature/bidi-rapid-metrics

Conversation

@sahusneha2004

Copy link
Copy Markdown

This PR introduces 7 new high-precision microsecond-level latency metrics for Bi-directional (Bidi) Read operations in the GCS Go SDK. This allows developers to monitor and pinpoint bottlenecks in download performance with microsecond granularity, distinguishing between SDK overhead, network transit, and server processing.

Key Metrics Added:
gcp.storage.client.bidi.stream_open_latency_us
gcp.storage.client.bidi.network_handshake_latency_us
gcp.storage.client.bidi.server_metadata_latency_us
gcp.storage.client.bidi.end_to_end_range_read_latency_us
gcp.storage.client.bidi.server_network_transit_latency_us
gcp.storage.client.bidi.sdk_processing_overhead_us
gcp.storage.client.bidi.client_handoff_delay_us

@sahusneha2004
sahusneha2004 requested review from a team as code owners July 23, 2026 11:32
@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Jul 23, 2026

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

Copy link
Copy Markdown
Contributor

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 adds detailed latency metrics for bidirectional read streams (bidi) in the GCS client, updates the HTTP client's OpenWriter to correctly wrap errors when max retry attempts are reached, and introduces comprehensive retry and header tests for both HTTP and gRPC. The review feedback highlights a potential nil pointer dereference on result.session in processDataRanges, suggests improving the precision of duration-to-microsecond conversions by avoiding intermediate float conversions through duration.Seconds(), and recommends fixing a minor typo in a metric description.

Comment thread storage/grpc_reader_multi_range.go Outdated
Comment thread storage/grpc_reader_multi_range.go Outdated
Comment thread storage/grpc_reader_multi_range.go Outdated
Comment thread storage/metrics.go Outdated
@sahusneha2004
sahusneha2004 force-pushed the feature/bidi-rapid-metrics branch 2 times, most recently from 5637775 to a218023 Compare July 23, 2026 12:00
…i reads

- Added 7 new latency metrics for Bidi operations.

- Switched to microsecond (_us) tracking.

- Fixed histogram boundaries and optimized precision math.

- Added defensive nil checks.
@sahusneha2004
sahusneha2004 force-pushed the feature/bidi-rapid-metrics branch from a218023 to f7bb1b6 Compare July 23, 2026 12:06
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