Repository navigation
feat(storage): wire MetricsRecordingCredentials into HTTP and gRPC StorageOptions - #15234
Open
nidhiii-27 wants to merge 9 commits into
Open
nidhiii-27 wants to merge 9 commits into
nidhiii-27 wants to merge 9 commits into
Conversation
…orageOptions Wire MetricsRecordingCredentials into HttpStorageOptions.getScopedCredentials() and GrpcStorageOptions.resolveSettingsAndOpts() when OpenTelemetry debug metrics are enabled, without mutating this.credentials or eagerly allocating an owned SdkMeterProvider when debug metrics are off. Preserve unwrapped ComputeEngineCredentials on gRPC for DirectPath ALTS bound tokens and EndpointContext universe domain validation. [Generated-by: AI]
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates GrpcStorageOptions and HttpStorageOptions to wrap credentials in MetricsRecordingCredentials when OpenTelemetry debug metrics are enabled, while keeping ComputeEngineCredentials unwrapped on gRPC to preserve DirectPath ALTS hard-bound tokens. Comprehensive unit tests are added to verify these behaviors. The review feedback highlights potential NullPointerException risks in both options if the credentials are null, suggesting defensive null checks before wrapping.
…age-credential-refresh-wiring [Generated-by: AI]
Merge feat/storage-credential-refresh-wrapper (26a80d4) and replace mock(ComputeEngineCredentials.class) in grpcStorageOptions_wiresCredentialsWithoutMutating with a real ComputeEngineCredentials instance carrying a pre-populated AccessToken. In google-auth-library 1.58.0, JSpecify @NullMarked (whose @target includes ElementType.MODULE) causes ByteBuddy annotation inspection to throw ArrayStoreException on JDK 8. [Generated-by: AI]
…age-credential-refresh-wiring [Generated-by: AI]
…age-credential-refresh-wiring [Generated-by: AI]
…age-credential-refresh-wiring [Generated-by: AI]
nidhiii-27
marked this pull request as ready for review
November 26, 2026 06:05
nidhiii-27
requested review from
Dhriti07 and
cpriti-os
and removed request for
a team
November 26, 2026 06:05
cpriti-os
previously approved these changes
Nov 26, 2026
cpriti-os
dismissed
their stale review
November 26, 2026 06:54
Initial review only — holding approval pending final pass
…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]
… feedback - Merge origin-auth/feat/storage-credential-refresh-wrapper (707f1c1) - Set SerializableFakeClock on httpDebugOptions, trigger refresh(), and assert credential_refresh.duration - Pass throwing MeterProvider to httpStdOptions verifying metrics are not initialized when debug is off
Merge commit cdca421 from feat/storage-grpc-veneer-operation-metrics to replace Mockito.mock(StreamController.class) with TestUtils.nullStreamController() in GrpcStorageImplTest, resolving split-units (java-storage, 8) failures caused by JSpecify @NullMarked on StreamController under JDK 8. [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.
Summary
Stacked on #15233.
Wires
MetricsRecordingCredentialsintoHttpStorageOptionsandGrpcStorageOptionswhen OpenTelemetry debug metrics are enabled, without mutatingthis.credentialsor eagerly allocating an ownedSdkMeterProviderwhen debug metrics are disabled.Changes
HttpStorageOptions.getScopedCredentials(): gate onisEnableOtelDebugMetrics()before callinggetStorageClientMetrics(), and wrap the returned scoped credentials viaMetricsRecordingCredentials.wrap(...)without mutatingthis.credentials(preservinggetCredentials(),ServiceAccountSigner,toBuilder(),equals(),hashCode(), andSerializable).GrpcStorageOptions.resolveSettingsAndOpts(): gate onisEnableOtelDebugMetrics()and leaveComputeEngineCredentialsunwrapped on gRPC soInstantiatingGrpcChannelProviderpreserves DirectPath ALTS hard-bound tokens andEndpointContextskips unnecessary MDS universe domain lookups; wrap other credentials before the quota-project probe andQuotaProjectIdHidingCredentials.MetricsRecordingCredentialsTestcovering HTTP and gRPC wiring, debug-disabled passthrough,QuotaProjectIdHidingCredentialsinteraction, and gRPCComputeEngineCredentialspreservation.[Generated-by: AI]