GeezerVison is showing github.com — feat(storage): wire logical operation metrics in Retrying and StorageOptions by nidhiii-27 · Pull Request #14695 · googleapis/google-cloud-java
Conversation
nidhiii-27
commented
Oct 20, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Wires client-level metrics lifecycle and retrier operation metrics into StorageOptions and Retrying.
- Initializes
StorageClientMetrics provider and lifecycle management in StorageOptions.
- Instruments
Retrying to record operation attempts, durations, and status attributes.
- Adds comprehensive unit tests (
StorageOptionsTest, StorageClientMetricsTest, RetryingMetricsTest).
Stacked on #14728.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
gemini-code-assist[bot] reacted with eyes emoji
There was a problem hiding this comment.
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 into the client-side retry mechanism of Google Cloud Storage. It updates StorageOptions, GrpcStorageOptions, and HttpStorageOptions to expose StorageClientMetrics, and modifies Retrying.DefaultRetrier to record attempts, errors, retries, operations, and duration metrics when metrics are enabled. Additionally, a comprehensive test suite RetryingMetricsTest has been added to verify metric collection across various retry scenarios. There are no review comments, and I have no feedback to provide.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nidhiii-27
added a commit
that referenced
this pull request
Oct 20, 2026
…options
- Narrow PR #14695 to core Retrying chokepoint and options wiring
- Remove per-run StorageMetricsContext binding from DefaultRetrierWithAlg to avoid elapsed time drift across runs
- Add createMetricsContext helper on StorageOptions
- Revert veneer operation wiring and server address attributes to separate stacked PR
- Update unit tests in RetryingMetricsTest
[Generated-by: AI]
…nfiguration
- Add configuration options to StorageOptions, GrpcStorageOptions, and HttpStorageOptions (enableOtelMetrics, enableOtelDebugMetrics, meterProvider, metricInterval).
- Add development gate checking system properties and environment variables in StorageMetricsConfig.
- Implement package-private instrument registry in StorageClientMetrics.
- Update OpenTelemetryBootstrappingUtils to register client views with custom histogram boundaries and create client meter provider.
- Add comprehensive unit tests in StorageOptionsTest, StorageClientMetricsTest, and OpenTelemetryBootstrappingUtilsTest.
Apply spotify fmt-maven-plugin formatting to StorageMetricsConfig, StorageClientMetrics, StorageOptionsTest, and StorageClientMetricsTest.
[Generated-by: AI]
Use simple class name Duration instead of fully qualified java.time.Duration in GrpcStorageOptions and OpenTelemetryBootstrappingUtils.
[Generated-by: AI]
…trappingUtils
Apply spotify fmt-maven-plugin formatting to OpenTelemetryBootstrappingUtils.
[Generated-by: AI]
…nd views [Generated-by: AI]
… metrics
Refactor addClientHistogramView in OpenTelemetryBootstrappingUtils to remove unit selector and custom view description, preserving instrument default descriptions.
Remove deferred Phase 2 connection metrics (dnsLookupDuration, tcpConnectDuration, tlsHandshakeDuration) from StorageClientMetrics, CLIENT_LATENCY_HISTOGRAMS, and StorageClientMetricsTest.
Ensure clean Duration imports.
[Generated-by: AI]
…rProvider
Default api parameter to "grpc" instead of "storage" in createClientMeterProvider, allow specifying "json" / "http" transport protocols for Cloud Monitoring monitored resource storage.googleapis.com/Client, and add unit test coverage in OpenTelemetryBootstrappingUtilsTest.
[Generated-by: AI]
Update createClientMeterProvider to use prefix custom.googleapis.com with default monitored resource mapping.
Add KEY_URL_TEMPLATE attribute key constant in StorageClientMetrics.
[Generated-by: AI]
…for default monitored resource
…geClientMetricsTest [Generated-by: AI]
…vements
[Generated-by: AI]
- Consolidate CONNECTION_REFUSED, CONNECTION_RESET, and CONNECTIVITY into CONNECTION_ERROR.
- Keep DEADLINE_EXCEEDED for server/RPC status codes and HTTP 408/504, reserving TIMEOUT for client timeouts.
- Map HTTP 409 to ABORTED.
- Include IOException in hasSpecificClientCause so wrapped IOExceptions map to CONNECTION_ERROR.
- Match server-side CRC32C and MD5 checksum mismatch messages in isChecksumMismatch.
[Generated-by: AI]
Explicitly declare com.google.api:gax-httpjson in java-storage/google-cloud-storage/pom.xml to satisfy Maven dependency:analyze.
[Generated-by: AI]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for addressing all the review comments!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
- Check status.getCause() and server checksum mismatch descriptions on INVALID_ARGUMENT and DATA_LOSS in mapGrpcStatus
- Simplify StorageException cause handling in mapThrowable by calling mapKnownCause directly
- Restrict (crc32c || md5) && match server checksum error pattern to HTTP 400 and gRPC INVALID_ARGUMENT / DATA_LOSS
- Add unit tests for mapGrpcStatus causes/descriptions and negative 404/412 checksum message cases
[Generated-by: AI]
…ic-libraries-bom
[Generated-by: AI]
… entry points
[Generated-by: AI]
- Move self-causation check to the bottom of the while loop in extractRpcStatusCode and extractHttpStatusCode so top-level self-causing exceptions are inspected first
- Add defensive null checks on getStatus() and getCode() for StatusRuntimeException and StatusException in extractRpcStatusCode
- Add unit tests for top-level self-causing exceptions and null status on gRPC status exceptions
[Generated-by: AI]
…n StorageErrorTypeMapper
- Reword class Javadoc to remove HLD acronym.
- Delegate StatusRuntimeException and StatusException directly to mapGrpcStatus.
- Cap cause-chain traversal depth (MAX_CAUSE_DEPTH = 20) across mapGrpcStatus and mapThrowable to guard against multi-node cause cycles (A -> B -> A).
[Generated-by: AI]
…or-mapping' into feat/storage-metrics-context
…se.status_code
[Generated-by: AI]
…e branch
[Generated-by: AI]
Uh oh!
There was an error while loading. Please reload this page.
nidhiii-27
added a commit
that referenced
this pull request
Nov 16, 2026
…nels (#14698)
Wires operation metrics into shared storage channels and the HTTP/JSON
veneer implementation.
- Plumbs `StorageMetricsContext` into `BaseStorageReadChannel` and
`BaseStorageWriteChannel` to record operations on close.
- Instruments `StorageImpl`, `HttpCopyWriter`, and HTTP channel wrappers
(`BlobReadChannelV2`, `BlobWriteChannelV2`).
- Updates `CopyWriterTest` unit tests.
Stacked on #14695.
Reviewers
Dhriti07
Dhriti07 approved these changes
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|