Repository navigation
feat(storage): support DirectPath over Interconnect in Cloud Monitoring and register channel_creation_latency view - #15025
nidhiii-27 wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces tracking for gRPC channel creation latency metrics and refactors endpoint parsing in OpenTelemetryBootstrappingUtils to be more robust, particularly for C2P and DirectPath interconnect hosts. It also adds corresponding unit tests to validate these changes. The review feedback points out a redundant check in the stream filter of getCloudMonitoringEndpoint and suggests simplifying it using a method reference on resolvedHost to improve clarity and correctness.
…ng and register channel_creation_latency view - Register storage.googleapis.com/internal/client/channel_creation_latency histogram view in OpenTelemetryBootstrappingUtils.createMeterProvider. - Expose MeterProvider from enableGrpcMetrics via GrpcMetricsChannelConfigurator implementing Supplier<MeterProvider> while preserving the existing method signature. - Update getCloudMonitoringEndpoint to support DirectPath over Cloud Interconnect endpoints (storage-direct.googleapis.com, storage-preprod-direct.sandbox.googleapis.com, storage-direct.<universeDomain>, and google-c2p:/// / google-c2p-experimental:/// targets with query/fragment parameters) with defensive null/empty handling. - Add unit tests in OpenTelemetryBootstrappingUtilsTest. [Generated-by: AI]
[Generated-by: AI]
[Generated-by: AI]
a306a43 to
640013f
Compare
[Generated-by: AI]
…cy recorder [Generated-by: AI]
kalragauri
left a comment
There was a problem hiding this comment.
A few notes on the description:
- It lists
storage-direct.googleapis.comand the preprod host as newly handled, but both already resolve tomonitoring.googleapis.comonmain. The actual changes are the universe-domain host, query and fragment stripping, the experimental scheme, and null handling. - Host matching moved from
containsto exact equality. That is a behavior change worth calling out. createChannelCreationLatencyRecorderand theSupplier<MeterProvider>have no production caller in this PR. A link to #15065, where they are wired in, would help reviewers.
…d metrics bootstrap [Generated-by: AI]
| "By", | ||
| "A view of grpc/client/attempt/sent_total_compressed_message_size with histogram boundaries" | ||
| + " more appropriate for Google Cloud Storage RPCs"); | ||
| registerGrpcChannelViews(providerBuilder); |
There was a problem hiding this comment.
Missed this in the earlier pass: deleting registerGrpcChannelViews(providerBuilder) here does not fail any test, because registerGrpcChannelViews is only tested directly. Can we assert that provider.toString() contains OpenTelemetryBootstrappingUtils.CHANNEL_CREATION_LATENCY_VIEW_NAME in bootstrapGrpcMetrics_withProjectId_composesConfiguratorAndExposesMeterProvider to cover this wiring?
There was a problem hiding this comment.
Done — added an assertion on provider.toString() containing CHANNEL_CREATION_LATENCY_VIEW_NAME in bootstrapGrpcMetrics_withProjectId_composesConfiguratorAndExposesMeterProvider.
Co-authored by AI Agent
…apGrpcMetrics [Generated-by: AI]
Summary
Adds Cloud Monitoring endpoint support for custom-universe DirectPath over Cloud Interconnect (DP over GCI) and C2P targets, and registers the
channel_creation_latencyOpenTelemetry histogram view and recorder ingoogle-cloud-storage.Note:
bootstrapGrpcMetrics/GrpcMetricsBootstrapResultandcreateChannelCreationLatencyRecorderare introduced here without a production caller and are wired intoGrpcStorageOptions/GrpcChannelTelemetryin #15065.Key Changes
OpenTelemetryBootstrappingUtils:storage.googleapis.com/internal/client/channel_creation_latencyhistogram view increateMeterProviderviaregisterGrpcChannelViews.createChannelCreationLatencyRecorder(configured with explicit seconds-scale latency bucket boundaries advice andtransport_typeattribute) for recording first-channel creation latency.bootstrapGrpcMetrics(...)returningGrpcMetricsBootstrapResult(holding both the composedChannelConfiguratorand@Nullable MeterProvider), withenableGrpcMetrics(...)delegating to it to preserve the existing signature.getCloudMonitoringEndpoint(and shared host parsing) to stripgoogle-c2p-experimental:///schemes as well as?queryand#fragmentsuffixes, supportstorage-direct.<universeDomain>, handlenull/empty endpoints defensively, and switch host matching from substringcontainsto exact equality (storage.<universeDomain>,storage-direct.<universeDomain>,private.<domain>,restricted.<domain>).OpenTelemetryBootstrappingUtilsTest:bootstrapGrpcMetrics,getCloudMonitoringEndpoint(custom-universe DirectPath over Interconnect, C2P query/fragment stripping with non-default ports, exact host matching,extractHostFallback, and null/empty handling),registerGrpcChannelViews, andcreateChannelCreationLatencyRecorder.