-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for different metric prefixes in StackdriverMeterRegistry #3171
Comments
I would generally prefer to have less configuration options for users to potentially configure things incorrectly or suboptimally if there isn't a good reason. Is there a reason we shouldn't change the hard-coded prefix to Also, we default to the
We could switch the default to |
The basic problem is the need to rework alerts and dashboards when you change the metric prefix. About resource type. Changing the default type global could be problematic because of the labels. Some of the labels has values validation so cannot be e.g. empty when there are not relevant (location is verifies if is proper region, at least for k8s_container type). Due to these 2 problems, changing the default prefix and recourse type could be problematic and easier to just make it optional. |
That's a very good point. We don't want to break things for users or create unnecessary friction in upgrading versions. Thanks for confirming about the resource type. Seeing as the prefix has multiple valid options and different users may have different preferences/needs, it probably makes sense for it to be arbitrarily configurable. It's a shame we probably can't do much validation for users, but it doesn't seem like there is a fixed set of valid values - after all the mentioned values didn't used to be valid. Would you like to contribute the change to allow configuring the prefix? |
Instead of hard-coding the MetricType prefix, this makes it configurable, as there are multiple options for valid prefixes, and different users may want to use different ones. The default is kept the same as before for backwards compatibility reasons. Resolves gh-3171 Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com>
Please describe the feature request.
Add support for different prefixes in StackdriverMeterRegistry. Currently it is hardcoded with "custom.googleapis.com/" here:
https://github.com/micrometer-metrics/micrometer/blob/main/implementations/micrometer-registry-stackdriver/src/main/java/io/micrometer/stackdriver/StackdriverMeterRegistry.java#L429
It could be either property with any value provided by user (with default to "custom.googleapis.com/") or just property to switch from the old prefix to the new one - "external.googleapis.com/user/".
Rationale
The new prefix, "external.googleapis.com/user", become available for custom metrics: https://cloud.google.com/monitoring/custom-metrics#identifier
It is recommended especially when using same metrics in different project as it has some optimization and amenities for that case:
https://cloud.google.com/monitoring/api/metrics_other#user
The text was updated successfully, but these errors were encountered: