Expose option to provide MetricServiceSettings in MetricConfiguration#356
Conversation
| * using: | ||
| * | ||
| * <ul> | ||
| * <li>{@link MetricConfiguration.Builder#setInsecureEndpoint(boolean)} |
There was a problem hiding this comment.
Did you explore making these functions work with or update MetricServiceSettings?
There was a problem hiding this comment.
Yes, I did try to reconcile these functions with the setMetricServiceSettings, but it lead to a confusing API. All of these functions eventually affect the properties of the underlying MetricServiceSettings object used to create the client.
So in a config like:
return MetricConfiguration.builder()
.setMetricServiceSettings(metricServiceSettingsBuilder.build())
.setCredentials(validCredentials)
// sets the channel to use NoCredentialsProvider and plainText.
.setInsecureEndpoint(true)
.setMetricServiceEndpoint(someEndpoint)
.build();It would become confusing for the user to predict/understand what the final configuration holds. Ignoring these other settings when setMetricServiceSettings is used keeps the implementation clean and the intent of the API clear to the user.
We also have exposed the defaults which the users can plug-in when constructing the MetricServiceSettings object.
…rces-support to v0.31.0 (#3044) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [com.google.cloud.opentelemetry:detector-resources-support](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-java) | `0.30.0` -> `0.31.0` | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- > [!WARNING] > Some dependencies could not be looked up. Check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>GoogleCloudPlatform/opentelemetry-operations-java (com.google.cloud.opentelemetry:detector-resources-support)</summary> ### [`v0.31.0`](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-java/releases/tag/v0.31.0) [Compare Source](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-java/compare/v0.30.0...v0.31.0) #### Release Highlights - Adds exporter configuration option to disable attaching instrumentation library labels. - Adds exporter configuration option to provide `MetricServiceSettings` object to configure the underlying service client used to interact with Cloud Monitoring API. #### What's Changed - Update instructions to reflect recent auth changes by [@​psx95](https://togithub.com/psx95) in [https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/pull/354](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-java/pull/354) - Remove unused OpenCensus dependency by [@​psx95](https://togithub.com/psx95) in [https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/pull/355](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-java/pull/355) - Expose option to provide MetricServiceSettings in MetricConfiguration by [@​psx95](https://togithub.com/psx95) in [https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/pull/356](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-java/pull/356) - Add config option to disable attaching InstrumentationLibrary labels by [@​psx95](https://togithub.com/psx95) in [https://github.com/GoogleCloudPlatform/opentelemetry-operations-java/pull/358](https://togithub.com/GoogleCloudPlatform/opentelemetry-operations-java/pull/358) **Full Changelog**: GoogleCloudPlatform/opentelemetry-operations-java@v0.30.0...v0.31.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/sdk-platform-java). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjUuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQzOC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Description
This PR adds a configuration option to the
MetricConfigurationthat allows the user to configure the underlying instance ofMetricServiceClientwhich is used by the exporter to interact with the Cloud Monitoring API.This feature is intended for advanced use-cases only.
Testing
setMetricServiceSettingsfunction.fixes. #149