Skip to content

fix(storage): use client credentials and universe domain for metrics - #15193

Open
Dhriti07 wants to merge 2 commits into
mainfrom
storage-metrics-client-credentials
Open

Dhriti07 wants to merge 2 commits into
mainfrom
storage-metrics-client-credentials

Conversation

@Dhriti07

Copy link
Copy Markdown
Contributor

The Cloud Monitoring exporter used for storage client metrics now uses the same credentials and universe domain as the storage client.

The Cloud Monitoring exporter used for storage client metrics now uses the
same credentials and universe domain as the storage client.

@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 updates the OpenTelemetry bootstrapping utility to configure the Cloud Monitoring exporter with the same credentials and universe domain as the Google Cloud Storage client. It introduces MetricServiceSettings creation logic that resolves the universe domain, verifies credential compatibility, and applies them to the exporter. Additionally, host parsing is improved to handle query parameters and fragments. The reviewer suggested also applying the default deadline timeout to createTimeSeriesSettings() and createServiceTimeSeriesSettings() in createMetricServiceSettings to ensure consistent timeout behavior during metric exports.

Comment on lines +245 to +247
builder
.createMetricDescriptorSettings()
.setSimpleTimeoutNoRetriesDuration(MetricConfiguration.DEFAULT_DEADLINE);

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.

medium

The exporter writes metrics using createTimeSeries or createServiceTimeSeries RPCs. If we only configure the timeout for createMetricDescriptorSettings(), the actual metric exports will use the default transport timeouts (which can be much longer) instead of MetricConfiguration.DEFAULT_DEADLINE. We should apply the same deadline to createTimeSeriesSettings() and createServiceTimeSeriesSettings() to ensure consistent timeout behavior across all exporter operations.

      builder
          .createMetricDescriptorSettings()
          .setSimpleTimeoutNoRetriesDuration(MetricConfiguration.DEFAULT_DEADLINE);
      builder
          .createTimeSeriesSettings()
          .setSimpleTimeoutNoRetriesDuration(MetricConfiguration.DEFAULT_DEADLINE);
      builder
          .createServiceTimeSeriesSettings()
          .setSimpleTimeoutNoRetriesDuration(MetricConfiguration.DEFAULT_DEADLINE);

@Dhriti07
Dhriti07 marked this pull request as ready for review November 24, 2026 10:40
@Dhriti07
Dhriti07 requested review from a team as code owners November 24, 2026 10:40

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant