Skip to content

feat(storage): support DirectPath over Interconnect in Cloud Monitoring and register channel_creation_latency view - #15025

Open
nidhiii-27 wants to merge 7 commits into
mainfrom
feat/storage-dp-interconnect-channel-metrics
Open

nidhiii-27 wants to merge 7 commits into
mainfrom
feat/storage-dp-interconnect-channel-metrics

Conversation

@nidhiii-27

@nidhiii-27 nidhiii-27 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds Cloud Monitoring endpoint support for custom-universe DirectPath over Cloud Interconnect (DP over GCI) and C2P targets, and registers the channel_creation_latency OpenTelemetry histogram view and recorder in google-cloud-storage.

Note: bootstrapGrpcMetrics / GrpcMetricsBootstrapResult and createChannelCreationLatencyRecorder are introduced here without a production caller and are wired into GrpcStorageOptions / GrpcChannelTelemetry in #15065.

Key Changes

  • OpenTelemetryBootstrappingUtils:
    • Registers the storage.googleapis.com/internal/client/channel_creation_latency histogram view in createMeterProvider via registerGrpcChannelViews.
    • Adds createChannelCreationLatencyRecorder (configured with explicit seconds-scale latency bucket boundaries advice and transport_type attribute) for recording first-channel creation latency.
    • Adds package-private bootstrapGrpcMetrics(...) returning GrpcMetricsBootstrapResult (holding both the composed ChannelConfigurator and @Nullable MeterProvider), with enableGrpcMetrics(...) delegating to it to preserve the existing signature.
    • Updates getCloudMonitoringEndpoint (and shared host parsing) to strip google-c2p-experimental:/// schemes as well as ?query and #fragment suffixes, support storage-direct.<universeDomain>, handle null/empty endpoints defensively, and switch host matching from substring contains to exact equality (storage.<universeDomain>, storage-direct.<universeDomain>, private.<domain>, restricted.<domain>).
  • OpenTelemetryBootstrappingUtilsTest:
    • Adds unit tests for bootstrapGrpcMetrics, getCloudMonitoringEndpoint (custom-universe DirectPath over Interconnect, C2P query/fragment stripping with non-default ports, exact host matching, extractHostFallback, and null/empty handling), registerGrpcChannelViews, and createChannelCreationLatencyRecorder.

@nidhiii-27 nidhiii-27 added the ai-generated Pull Request generated by AI label Nov 16, 2026

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

Copy link
Copy Markdown
Contributor

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 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]
@nidhiii-27
nidhiii-27 force-pushed the feat/storage-dp-interconnect-channel-metrics branch from a306a43 to 640013f Compare November 18, 2026 06:50
@nidhiii-27 nidhiii-27 added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 18, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Nov 18, 2026
@nidhiii-27
nidhiii-27 marked this pull request as ready for review November 18, 2026 10:20
@nidhiii-27
nidhiii-27 requested review from a team as code owners November 18, 2026 10:20

@kalragauri kalragauri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few notes on the description:

  • It lists storage-direct.googleapis.com and the preprod host as newly handled, but both already resolve to monitoring.googleapis.com on main. The actual changes are the universe-domain host, query and fragment stripping, the experimental scheme, and null handling.
  • Host matching moved from contains to exact equality. That is a behavior change worth calling out.
  • createChannelCreationLatencyRecorder and the Supplier<MeterProvider> have no production caller in this PR. A link to #15065, where they are wired in, would help reviewers.

"By",
"A view of grpc/client/attempt/sent_total_compressed_message_size with histogram boundaries"
+ " more appropriate for Google Cloud Storage RPCs");
registerGrpcChannelViews(providerBuilder);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — added an assertion on provider.toString() containing CHANNEL_CREATION_LATENCY_VIEW_NAME in bootstrapGrpcMetrics_withProjectId_composesConfiguratorAndExposesMeterProvider.

Co-authored by AI Agent

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-generated Pull Request generated by AI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants