Skip to content

feat(storage): add telemetry for pre-warmed ranges in ObjectDescriptorImpl - #16323

Open
kalragauri wants to merge 4 commits into
googleapis:mainfrom
kalragauri:feat/range-evict
Open

feat(storage): add telemetry for pre-warmed ranges in ObjectDescriptorImpl#16323
kalragauri wants to merge 4 commits into
googleapis:mainfrom
kalragauri:feat/range-evict

Conversation

@kalragauri

@kalragauri kalragauri commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

This PR adds OpenTelemetry instrumentation for multi-range pre-warming requests in the GCS async client.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Aug 5, 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 tracking and telemetry for the cache status ("HIT", "MISS", "EVICTED") of pre-warmed ranges in ObjectDescriptorImpl, recording it as an OpenTelemetry span attribute. The review feedback suggests limiting the size of the new evicted_ranges_ set to prevent unbounded memory growth, and optimizing performance by using absl::string_view instead of std::string to avoid unnecessary copies of the cache status.

Comment thread google/cloud/storage/internal/async/object_descriptor_impl.cc Outdated
Comment thread google/cloud/storage/internal/async/object_descriptor_reader_tracing.cc Outdated
Comment thread google/cloud/storage/internal/async/object_descriptor_reader_tracing.cc Outdated
@kalragauri kalragauri changed the title feat(storage): add fast_open_cache_status telemetry for pre-warmed ranges in ObjectDescriptorImpl feat(storage): add telemetry for pre-warmed ranges in ObjectDescriptorImpl Aug 5, 2026
@kalragauri
kalragauri marked this pull request as ready for review August 5, 2026 09:04
@kalragauri
kalragauri requested review from a team as code owners August 5, 2026 09:04
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.63158% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.23%. Comparing base (c6a56cb) to head (25078ba).

Files with missing lines Patch % Lines
...d/storage/internal/async/object_descriptor_impl.cc 31.81% 15 Missing ⚠️
...cloud/storage/internal/async/connection_tracing.cc 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16323      +/-   ##
==========================================
- Coverage   92.24%   92.23%   -0.01%     
==========================================
  Files        2227     2227              
  Lines      209208   209234      +26     
==========================================
+ Hits       192976   192982       +6     
- Misses      16232    16252      +20     

☔ 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.

Comment thread google/cloud/storage/internal/async/connection_tracing.cc Outdated
Comment thread google/cloud/storage/internal/async/object_descriptor_impl.cc Outdated
Comment thread google/cloud/storage/internal/async/object_descriptor_impl.cc
Comment thread google/cloud/storage/internal/async/object_descriptor_reader_tracing.cc Outdated
@kalragauri
kalragauri requested a review from bajajneha27 August 10, 2026 04:55
// Check if this range matches a pre-warmed range.
auto cache_key = std::make_pair(p.start, p.length);
auto cache_it = prewarmed_ranges_.find(cache_key);
auto cache_status = InitialReadRangesCacheStatus::kMiss;

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.

So every standard read on a normal descriptor (without ReadRangesOption) attaches gl-cpp.initial-read-ranges.cache-status:kMiss? Is it decided behaviour? Also will it add noise in Otel?

}

private:
absl::string_view cache_status_;

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.

Is it safe to use string_view here? if cache_status will be deleted then it might point to free memory?

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.

3 participants