Repository navigation
feat(storage): record gcp.storage.client.retries counter in Retrying - #15225
Open
nidhiii-27 wants to merge 2 commits into
Open
nidhiii-27 wants to merge 2 commits into
nidhiii-27 wants to merge 2 commits into
Conversation
…[Generated-by: AI]
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a new metric, gcp.storage.client.retries, to track the number of GCS client attempts that retried an earlier failed attempt of the same request. It refactors the exception handling in Retrying.java to use a helper method handleAttemptError which records both attempt failures and retries. Additionally, corresponding updates were made to StorageClientMetrics and StorageMetricsContext to support this new metric, and comprehensive unit tests were added to verify its behavior and attributes. I have no feedback to provide as there are no review comments to evaluate.
cpriti-os
requested changes
Nov 25, 2026
cpriti-os
reviewed
Nov 26, 2026
- Combine the StorageException and IllegalArgumentException catches in Retrying. - Shorten the retries counter description. - Drop StorageClientMetricsTest.recordRetry_recordsExactAttributes; the end-to-end RetryingMetricsTest covers the exact attribute set. [Generated-by: AI]
cpriti-os
approved these changes
Nov 26, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Stacked on #15066.
Adds the Standard-tier
gcp.storage.client.retriesOpenTelemetry counter (unit{attempt}) and records retries executed byRetrying.DefaultRetrier.run(...)across both HTTP/JSON and gRPC operations.Changes
StorageClientMetrics: add Standard-tiergcp.storage.client.retriesLongCounter(unit{attempt}, description "Number of GCS client retry attempts") andrecordRetry(Context, String operationName, String networkPath, String errorType)emitting the 8 standard retry attributes (gcp.client.service,gcp.client.version,gcp.client.artifact,rpc.system.name,server.address,gcp.storage.operation,network.path,error.type).OpenTelemetryBootstrappingUtils: registergcp.storage.client.retriesinCLIENT_COUNTERS.StorageMetricsContext: addrecordRetry(StorageClientMetrics, Throwable)using the active operation, resolvednetwork.path, and the failed attempt's mappederror.type.Retrying.DefaultRetrier: whenever the retry algorithm schedules another attempt, record a retry with the failed attempt'serror.type(sharedhandleAttemptErrorhelper;StorageException | IllegalArgumentExceptionmulti-catch).StorageClientMetricsTestandRetryingMetricsTest(end-to-end exact-attribute coverage viaStorageOptions.grpc()).[Generated-by: AI]