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
Need to be able to collect metrics without adding an instance (or job or exporter_instance or exporter_job) label #490
Comments
Then we also have to change the behavior of pushgateway, which guarantees that an instance label is added. (We could do {instance="n/a"} as a work-around, but then people have to think of it. The old rationale was that only people who know what they are doing would set an instance label different from the host ip...) |
There's use cases beyond pushgateway. The main use case is where you want no instance label at all, and there's also use cases where you want an instance label without exporter_instance being added. |
Without having a whole lot about it, I'd say having a "no-instance" target config option would be easy to add and pretty risk-free (as users have to explicitly enable it). The specific pushgateway case has a few ramifications, see prometheus/pushgateway#18 |
Maybe "honor-instance", as sometimes you do want the instance label going through (aggregators). Do we need to worry more generally about when target labels clash with scraped labels? |
IIRC label crashes are currently always resolved by appending |
As recently discussed in prometheus/pushgateway#18 , it looks we should have a directive |
New idea here:
Suggestion now is to not change the default prefix, but add a single scrape config option, which is That one additional option would, as a byproduct, allow us to switch off collision handling by setting the prefix to |
One thing I want to change about this is which label gets the collision prefix, as it should be the scraped label rather than the target label that gets changed. The idea here is that in normal usage, you don't want a rouge job to be able to generate labels for other jobs that may break their alerts/consoles. This wouldn't allow for what @beorn7 is proposing, but I don't think wanting to change the collision prefix is a major requirement as it's more about having a prefix than it's exact value. |
We could implement the preference (what is renamed (or disappear in the case of an empty prefix), what stays) as another option. But then you want to change the prefix even more dearly because 'exporter' becomes really confusing. We could just change the fixed prefix in the code, but that's a breaking change. So I think we should better make it configurable (and at the same time solve the problem this issue is about). Two birds with one stone. |
Aside from PGW, I haven't come across other servers using |
With the given growing userbase, I'd rather not assume too much. If we provide the option to change the collision prefix, at least you can keep things running even if the default changes. |
I agree that we should change the default precedence for collision handling. The question is: Should we flip it for good or making it configurable? People who depend on the old behavior could keep it if they want. The configurable prefix (for both cases) makes sense IMHO because it solves the pushgateway/federation need, too (by setting it to empty). |
For good. I've got a change in the works that'll as a side effect let it be undone if you really want to.
It solves it with the current precedence for collision handling, but not with the new precedence as the target labels would win. |
Which is a good reason to make the precedence configurable. :) |
But yeah, two things to flip to set up pushgateway or federation is kind of meh... |
Yeah, a single setting should be sufficient for the normal use cases. #490 would allow for someone who wanted the precedence to keep the current behaviour, but I'm having difficulty coming up with a use case that wouldn't be better served by the honor/federate behaviour. |
This is resolved with the |
…ist-header Fix stable/unstable list headers in 1.0 post
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Service-level stats are exported by things like the push gateway and cloudwatch exporter that don't have an instance label. Currently they'll end up with the instance, such as that of the target.
We need a way to signal that for some metrics, that the injection logic isn't to add in an instance or exporter_instance label. Maybe a flag in the config file for targets where this applies, and an empty instance label in the metric protobuf?
The text was updated successfully, but these errors were encountered: