GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@nidhiii-27 nidhiii-27 commented Oct 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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
All reactions
  • 👀 1 reaction
@nidhiii-27 nidhiii-27 added the ai-generated Pull Request generated by AI label Oct 20, 2026
gemini-code-assist[bot]
gemini-code-assist Bot reviewed Oct 20, 2026
View reviewed changes

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

Copy link
Copy Markdown
Contributor

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.

All reactions
@nidhiii-27
nidhiii-27 added this pull request to stack #14485 October 20, 2026 10:06
@nidhiii-27
nidhiii-27 force-pushed the feat/storage-metrics-context-error-mapping branch from 608c46a to 1bf9a9d Compare October 20, 2026 11:50
@nidhiii-27
nidhiii-27 force-pushed the feat/storage-logical-metrics branch from b385679 to 0a3696b Compare October 20, 2026 12:11
cpriti-os
cpriti-os requested changes Oct 20, 2026
View reviewed changes
Comment thread java-storage/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageOptions.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread java-storage/google-cloud-storage/src/main/java/com/google/cloud/storage/Retrying.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread java-storage/google-cloud-storage/src/main/java/com/google/cloud/storage/Retrying.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread ...torage/google-cloud-storage/src/main/java/com/google/cloud/storage/StorageClientMetrics.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread java-storage/google-cloud-storage/src/main/java/com/google/cloud/storage/GrpcStorageImpl.java Resolved

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
@nidhiii-27
refactor(storage): narrow logical metrics to Retrying chokepoint and …
26bca57
…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]
@nidhiii-27 nidhiii-27 mentioned this pull request Oct 20, 2026
feat(storage): wire operation metrics in HTTP veneer and storage channels #14698
Merged
@nidhiii-27
nidhiii-27 requested a review from cpriti-os October 21, 2026 17:56
@nidhiii-27
nidhiii-27 marked this pull request as ready for review October 22, 2026 05:02
@nidhiii-27
nidhiii-27 requested review from a team as code owners October 22, 2026 05:02
nidhiii-27 added 18 commits October 22, 2026 10:36
@nidhiii-27
feat(storage): add OpenTelemetry client metrics infrastructure and co…
07f72be
…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.
@nidhiii-27
fix(storage): resolve code formatting violations for client metrics
235a230
Apply spotify fmt-maven-plugin formatting to StorageMetricsConfig, StorageClientMetrics, StorageOptionsTest, and StorageClientMetricsTest.

[Generated-by: AI]
@nidhiii-27
fix(storage): resolve PR review comments on OpenTelemetry metrics
590ad9e
Use simple class name Duration instead of fully qualified java.time.Duration in GrpcStorageOptions and OpenTelemetryBootstrappingUtils.

[Generated-by: AI]
@nidhiii-27
fix(storage): resolve code formatting violation in OpenTelemetryBoots…
02a7740
…trappingUtils

Apply spotify fmt-maven-plugin formatting to OpenTelemetryBootstrappingUtils.

[Generated-by: AI]
@nidhiii-27
feat(storage): add OpenTelemetry client metrics instrument registry a…
f686723
…nd views [Generated-by: AI]
@nidhiii-27
fix(storage): refactor histogram views and remove deferred connection…
babb702
… 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]
@nidhiii-27
fix(storage): support transport-derived api label in createClientMete…
22a233f
…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]
@nidhiii-27
fix(storage): address review comments for OpenTelemetry client metrics
1f2c146
@nidhiii-27
feat(storage): address review feedback on client metrics infra
7828fd2
@nidhiii-27
style(storage): format code with fmt-maven-plugin
983f248
@nidhiii-27
refactor(storage): address PR review comments for OpenTelemetry clien…
52cd16a
…t metrics
@nidhiii-27
fix(storage): resolve review comments for client metrics infra
18b1e73
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]
@nidhiii-27
refactor(storage): preserve detectedAttributes in buildMeterProvider …
6e7a5c6
…for default monitored resource
@nidhiii-27
fix(metrics): update metric counter units to match Go SDK and design doc
57fa64a
@nidhiii-27
test(storage): deduplicate instrument nullability assertions in Stora…
f39f525
…geClientMetricsTest [Generated-by: AI]
@nidhiii-27
test(storage): initialize InMemoryMetricReader in @before and clean u…
a1f434d
…p comments
@nidhiii-27
refactor(storage): remove misleading @VisibleForTesting from histogra…
4607b23
…m boundary helpers
@nidhiii-27
refactor(storage): remove gcp.storage.client.retries counter [Generat…
97ed050
…ed-by: AI]
nidhiii-27 added 5 commits October 29, 2026 07:08
@nidhiii-27
fix(storage): address PR #14695 review comments and readability impro…
ac31ae2
…vements

[Generated-by: AI]
@nidhiii-27
fix(storage): resolve PR comments for StorageErrorTypeMapper
1ee3ce0
- 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]
@nidhiii-27
fix(storage): address review feedback in StorageMetricsContext
3dbd4e6
@nidhiii-27
fix(storage): declare gax-httpjson dependency in pom.xml
cb8882a
Explicitly declare com.google.api:gax-httpjson in java-storage/google-cloud-storage/pom.xml to satisfy Maven dependency:analyze.

[Generated-by: AI]
@nidhiii-27
fix(storage): remove unnecessary gax-httpjson dependency and reference
0d4cdde
cpriti-os
cpriti-os approved these changes Oct 31, 2026
View reviewed changes

@cpriti-os cpriti-os left a comment

Copy link
Copy Markdown
Contributor

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.

All reactions
nidhiii-27 and others added 13 commits November 2, 2026 10:31
@nidhiii-27
fix(storage): resolve PR comments for StorageMetricsContext
a008bbe
[Generated-by: AI]
@nidhiii-27
fix(storage): address final PR review comments in StorageErrorTypeMapper
fd0a88f
- 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]
@nidhiii-27
chore(storage): merge main to resolve spanner test compilation in gap…
ce389ea
…ic-libraries-bom

[Generated-by: AI]
@nidhiii-27
refactor(storage): move mapGaxStatusCode helper below package-private…
dfdd5c4
… entry points

[Generated-by: AI]
@nidhiii-27
fix(storage): harden status code extraction in StorageMetricsContext
1ed0bfc
- 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]
@Dhriti07
Merge branch 'main' into feat/storage-metrics-context-error-mapping
39a9734
@nidhiii-27
fix(storage): bound cause depth and simplify gRPC status delegation i…
1de15fc
…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]
@nidhiii-27
Merge remote-tracking branch 'origin/feat/storage-metrics-context-err…
1747bf4
…or-mapping' into feat/storage-metrics-context
@nidhiii-27
refactor(storage): address review feedback on StorageMetricsContext
c0daeb7
[Generated-by: AI]
@nidhiii-27
chore(storage): merge main into feat/storage-metrics-context
2fc50f6
[Generated-by: AI]
@nidhiii-27
fix(storage): use AttributeKey<Long> with 0L fallback for http.respon…
85ee83f
…se.status_code

[Generated-by: AI]
@Dhriti07
Merge branch 'feat/storage-metrics-context' into feat/storage-logical…
4e3b4a5
…-metrics
@nidhiii-27
fix(storage): align StorageMetricsContext and tests after merging bas…
a75f7ab
…e branch

[Generated-by: AI]
Base automatically changed from feat/storage-metrics-context to main November 11, 2026 20:00
@nidhiii-27
chore(storage): merge main into feat/storage-logical-metrics
26ae991
[Generated-by: AI]
Dhriti07
Dhriti07 approved these changes Nov 12, 2026
View reviewed changes
@Dhriti07
Merge branch 'main' into feat/storage-logical-metrics
95ca816
@Dhriti07 Dhriti07 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 12, 2026
@nidhiii-27
nidhiii-27 merged commit 589c66c into main Nov 12, 2026
204 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nidhiii-27
nidhiii-27 deleted the feat/storage-logical-metrics branch November 12, 2026 08:44
@nidhiii-27 nidhiii-27 removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 12, 2026
@release-please release-please Bot mentioned this pull request Nov 12, 2026
chore(main): release 1.97.0 #14996
Merged
whowes pushed a commit that referenced this pull request Nov 13, 2026
@release-please
chore(main): release 1.97.0 (#14996)
fd32569
🤖 I have created a release *beep* *boop*
---


<details><summary>1.97.0</summary>

##
[1.97.0](v1.96.0...v1.97.0)
(2026-11-12)


### ⚠ BREAKING CHANGES

* **shopping-merchant:** remove discontinued Merchant API v1beta
([#14942](#14942))

### Features

* **bigquery-jdbc:** adds BigQuery graph integration to DatabaseMetadata
methods
([#14930](#14930))
([950b81b](950b81b))
* **gax:** implement resumable upload session resumption
([#14677](#14677))
([24728d6](24728d6))
* **grpc-gcp:** add built-in channel_count metric for client library
pools
([#14947](#14947))
([712f043](712f043))
* **grpc-gcp:** add built-in channel_load metric for client library
pools
([#14985](#14985))
([9f87888](9f87888))
* **shopping-merchant:** remove discontinued Merchant API v1beta
([#14942](#14942))
([2947dfd](2947dfd))
* **storage:** add StorageErrorTypeMapper for standard metrics
([#14694](#14694))
([a9ac393](a9ac393))
* **storage:** add StorageMetricsContext for operation metrics state
([#14728](#14728))
([edea395](edea395))
* **storage:** wire logical operation metrics in Retrying and
StorageOptions
([#14695](#14695))
([589c66c](589c66c))
* update API sources and regenerate
([#14958](#14958))
([75944f3](75944f3))


### Bug Fixes

* **auth:** verify public/private key match with retries in mTLS
keystore loading
([#14829](#14829))
([096dbd6](096dbd6))
* **bigquery:** set QueryResultsFormat.ARROW in QueryArrow sample
([#14960](#14960))
([c98e7c3](c98e7c3))
* **bigtable:** avoid triggering per-RPC credential session fallback on
default call context
([#14961](#14961))
([eb06d2c](eb06d2c))
* **bigtable:** copy Metadata per GetClientConfiguration call
([#14950](#14950))
([278fe2f](278fe2f))
* **bigtable:** disable SwitchingChannelPool when
ChannelPoolConfiguration is empty
([#14911](#14911))
([fa24702](fa24702))
* **bigtable:** handle empty SessionPoolConfiguration in SessionPoolImpl
and PoolSizer
([#14912](#14912))
([cc7b235](cc7b235))
* **bigtable:** replace SessionPoolImpl Watchdog with per-session
closeTimeout
([#14977](#14977))
([a15acfb](a15acfb))
* **spanner-jdbc:** report database default isolation level
([#14929](#14929))
([7e7595a](7e7595a))
* **spanner:** fix PG SHOW isolation level statements
([#14904](#14904))
([bc917ed](bc917ed))


### Dependencies

* bump grpc to 1.85.1, opentelemetry to 1.67.0, and guava to 33.7.2-jre
([#14957](#14957))
([1a27a00](1a27a00))
* bump guava to 33.7.1-jre and jspecify to 1.0.1
([#14937](#14937))
([1441527](1441527))


### Documentation

* **spanner:** update CHANGELOG.md for java spanner releases
([#14935](#14935))
([956681e](956681e))
* **storage:** add Rapid Cache samples
([#14886](#14886))
([e714f62](e714f62))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
nidhiii-27 added a commit that referenced this pull request Nov 16, 2026
@nidhiii-27
feat(storage): wire operation metrics in HTTP veneer and storage chan…
e7248ce
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Dhriti07 Dhriti07 Dhriti07 approved these changes
@cpriti-os cpriti-os cpriti-os approved these changes
+1 more reviewer
@gemini-code-assist gemini-code-assist[bot] gemini-code-assist[bot] left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

ai-generated Pull Request generated by AI

Projects

None yet

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.

3 participants

@nidhiii-27 @Dhriti07 @cpriti-os
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.