Repository navigation
Conversation
The Cloud Monitoring exporter used for storage client metrics now uses the same credentials and universe domain as the storage client.
There was a problem hiding this comment.
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.
| builder | ||
| .createMetricDescriptorSettings() | ||
| .setSimpleTimeoutNoRetriesDuration(MetricConfiguration.DEFAULT_DEADLINE); |
There was a problem hiding this comment.
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);
The Cloud Monitoring exporter used for storage client metrics now uses the same credentials and universe domain as the storage client.