Skip to content

feat(storage): add OpenTelemetry counters for read hedging - #16410

Draft
ajayky-os wants to merge 1 commit into
googleapis:mainfrom
ajayky-os:feat/hedging-telemetry
Draft

feat(storage): add OpenTelemetry counters for read hedging#16410
ajayky-os wants to merge 1 commit into
googleapis:mainfrom
ajayky-os:feat/hedging-telemetry

Conversation

@ajayky-os

Copy link
Copy Markdown
Contributor

Add storage.read_hedging.hedges_dispatched and storage.read_hedging.hedge_won counters to track speculative attempts and secondary hedge wins.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Sep 3, 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 integrates OpenTelemetry metrics tracking for read hedging operations in HedgedObjectReadSource, introducing a new HedgedReadMetrics helper class. The review feedback highlights several style guide violations and optimization opportunities, including avoiding auto when it obscures return types, declaring loop variables in the narrowest scope, removing unnecessary braces for short if statements, and passing nullptr instead of creating a new metrics instance in the delegating constructor to avoid performance overhead.

Comment thread google/cloud/storage/internal/hedged_object_read_source.cc Outdated
Comment thread google/cloud/storage/internal/hedged_object_read_source.cc Outdated
Comment thread google/cloud/storage/internal/hedged_object_read_source.cc Outdated
Comment thread google/cloud/storage/internal/hedged_object_read_source.cc Outdated
@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.42857% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.28%. Comparing base (4200a62) to head (54f0996).

Files with missing lines Patch % Lines
google/cloud/storage/internal/connection_impl.cc 0.00% 4 Missing ⚠️
...loud/storage/internal/hedged_object_read_source.cc 96.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16410      +/-   ##
==========================================
+ Coverage   92.25%   92.28%   +0.03%     
==========================================
  Files        2246     2246              
  Lines      212528   212668     +140     
==========================================
+ Hits       196060   196259     +199     
+ Misses      16468    16409      -59     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ajayky-os

Copy link
Copy Markdown
Contributor Author

/gemini review

@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 for read hedging operations by adding a new HedgedReadMetrics class and integrating it into HedgedObjectReadSource and StorageConnectionImpl. The review feedback suggests optimizing the implementation by passing std::shared_ptr<HedgedReadMetrics> directly and using null checks instead of allocating dummy metrics on the heap when telemetry is disabled or not provided.

Comment thread google/cloud/storage/internal/hedged_object_read_source.cc
Comment thread google/cloud/storage/internal/hedged_object_read_source.cc Outdated
Comment thread google/cloud/storage/internal/hedged_object_read_source.cc Outdated
Add storage.read_hedging.hedges_dispatched and storage.read_hedging.hedge_won counters to track speculative attempts and secondary hedge wins.
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