Repository navigation
feat(storage): wire operation metrics in gRPC veneer - #14729
Open
nidhiii-27 wants to merge 101 commits into
Open
nidhiii-27 wants to merge 101 commits into
nidhiii-27 wants to merge 101 commits into
Conversation
…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]
…m boundary helpers
…ions [Generated-by: AI]
…rialization [Generated-by: AI]
… options - In GrpcStorageOptions and HttpStorageOptions: - Add null check in getMetricInterval() defaulting to 60 seconds - Use getMetricInterval() in equals() and hashCode() - Update Javadoc for setMeterProvider to document nullable/default behavior - In StorageOptions: - Update Javadoc for setMeterProvider on Builder - In StorageMetricsConfig: - Make sysPropResolver and envResolver volatile for thread safety - In StorageOptionsTest: - Add unit test verifying deserialization with null metricInterval defaults to 60s and equals/hashCode match - Verify explicit client options take precedence over env vars and sysprops [Generated-by: AI]
[Generated-by: AI]
Format StorageOptions, GrpcStorageOptions, HttpStorageOptions, and StorageOptionsTest using com.spotify.fmt:fmt-maven-plugin:2.25:format under JDK 17 to resolve CI lint check failure. [Generated-by: AI]
[Generated-by: AI]
…iew comments Clamp metric export interval to at least 60 seconds when meterProvider is null and no custom OpenTelemetry is configured, preventing invalid sub-60s intervals during deserialization when falling back to default Cloud Monitoring exporter. [Generated-by: AI]
…ig and tests Deduplicate flag resolution in StorageMetricsConfig by extracting resolveFlag helper, separate multi-behavior tests per go/tott/726, and add input diagnostic messages in looped assertions. [Generated-by: AI]
…Test [Generated-by: AI]
[Generated-by: AI]
[Generated-by: AI]
…se.status_code [Generated-by: AI]
…e branch [Generated-by: AI]
[Generated-by: AI]
…veneer-operation-metrics [Generated-by: AI]
…/storage-grpc-veneer-operation-metrics [Generated-by: AI]
…to feat/storage-veneer-operation-metrics
… and simplify runBoolean [Generated-by: AI]
…e-grpc-veneer-operation-metrics
…edundant createContext fallbacks [Generated-by: AI]
…ly create 404 sentinel [Generated-by: AI]
…e-grpc-veneer-operation-metrics [Generated-by: AI]
Base automatically changed from
feat/storage-veneer-operation-metrics
to
main
November 16, 2026 11:43
Dhriti07
reviewed
Dec 2, 2026
Dhriti07
reviewed
Dec 2, 2026
Dhriti07
requested changes
Dec 2, 2026
- Extract readToChannel helper in GrpcStorageImpl for readAllBytes and both downloadTo overloads, coalescing IOException to StorageException before recording error metrics and catching Throwable - Catch Throwable in multi-step ACL methods in GrpcStorageImpl - Preserve StorageMetricsContext across inner withDefaultCallContext/GrpcCallContext.merge calls in WriteObject paths - Remove redundant chunkContext alias in GapicCopyWriter and rename subAttemptContext to callContext - Split multi-behavior tests in GrpcStorageImplTest and add tests for last-page getNextPage(), IOException-wrapped StorageException, and WriteObject context propagation
…est for Java 8 compatibility Replace Mockito.mock(StreamController.class) with TestUtils.nullStreamController() in stubMidStreamReadFailure to avoid ByteBuddy JDK 8 failures when copying JSpecify @NullMarked annotations from StreamController. [Generated-by: AI]
nidhiii-27
added a commit
that referenced
this pull request
Dec 4, 2026
Bring in the Java 8 compatibility fix for GrpcStorageImplTest (TestUtils.nullStreamController() instead of Mockito.mock(StreamController.class)) from feat/storage-grpc-veneer-operation-metrics (#14729). [Generated-by: AI]
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.
Wires operation metrics into the gRPC veneer implementation.
GrpcStorageImplacross unary calls, multi-step ACL operations, and streaming operations.GapicCopyWriter,GrpcBlobReadChannel, andGrpcBlobWriteChannel.StorageMetricsContextacross innerwithDefaultCallContext/GrpcCallContext.mergeboundaries onWriteObjectchannels and sessions.TransformingPageDecorator.getNextPage()to check!hasNextPage()(returningnullwithout invokingretrier.run) and route page 2+ through the boundretrierso pagination attempts are recorded under theListBucketsmetrics context (per earlier review comment r4432540827).Stacked on #14698.