Skip to content
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

Question - Is it possible to disable scope prefix and sufix added to metric name? #502

Closed
CarlosPanarello opened this issue Dec 13, 2019 · 8 comments

Comments

@CarlosPanarello
Copy link

In the metric name is added the scope prefix like application, base or vendor and for counter metrics is added _total in the end of the metric name.
Is there any way to disable this?

@donbourne
Copy link
Member

@CarlosPanarello , there's no way currently to disable this.

There was some discussion, not that long ago, about letting implementations choose their metric name prefix, which would make metrics from MicroProfile fit better in a list of metrics amongst metrics from multiple products. eg. prefix all Open Liberty metrics with liberty_ . I still think that's a worthwhile idea.

Are you looking for adding a different prefix, or just getting rid of the scope prefix?

@CarlosPanarello
Copy link
Author

Just getting rid of it.

@donbourne
Copy link
Member

@CarlosPanarello , can you say a bit about why you want to remove the prefix? I see a couple of issues with that, but if I get what you want to accomplish I can try to think of ideas.

A problem with just getting rid of the prefix is that there are 3 separate metrics registries (base, vendor, application), each with its own namespace. Getting rid of it adds the possibility of a name collision. While that may be unlikely it does make us need to somehow deal with what would happen if there was a collision.

The other problem with having no prefix is runtimes typically start their metric names with their product name (see #384). Removing the prefix would cause all of the MP metrics to be spread across the alphabet of names, intermixed with better behaved metrics groups from individual products.

In #384 we were talking about adding an "mp_" prefix to the metric names so that they show up together in Prometheus/Grafana when you're trying to create dashboards.

@andrebreves
Copy link

can you say a bit about why you want to remove the prefix?

We have a heterogeneous ecosystem with services in multiple languages (Java, Go, TypeScript, Python...), and have agreed on a subset of metrics with standardized names (described here) to leverage already built grafana panels, alerts...

@donbourne
Copy link
Member

I'm personally in favor of getting rid of the prefixes now. I see why that's annoying in a world that isn't so MP-centric. Better to have names that start with the component they come from.

@june805
Copy link

june805 commented Sep 2, 2022

@donbourne Can we get rid of the prefix application_, base_, vendor_ now? I'd like to have our own name directly with my component name as prefix. Thank you.

@donbourne
Copy link
Member

@june805 , we're getting rid of the application_, base_, vendor_ prefixes in the upcoming MP Metrics v5.0. The scope will now be added to the metrics in a tag. That should enable you to have your own component name as the metric prefix. You can see what the new output will look like in https://github.com/eclipse/microprofile-metrics/blob/master/spec/src/main/asciidoc/rest-endpoints.adoc

@donbourne
Copy link
Member

The scope prefix has been removed in MP Metrics v5.0, so I would consider that part of this issue to be addressed.

The _total suffix for counter output is still expected, but that is a result of that being how the Prometheus Client formats counter output. Given MP Metrics v5.0 is aiming to be easy to implement with available metrics libraries, we're trying to keep our expectations for the output consistent with what metrics libraries are doing. So I don't expect we'll make the change to get rid of _total.

Please feel free to reopen, with comments, if you think this one hasn't been addressed properly.

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

No branches or pull requests

4 participants