Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upNeed to be able to collect metrics without adding an instance (or job or exporter_instance or exporter_job) label #490
Comments
brian-brazil
added
the
feature-request
label
Jan 30, 2015
beorn7
referenced this issue
Jan 30, 2015
Closed
Consider not assigning an instance label if none is requested #18
This comment has been minimized.
This comment has been minimized.
|
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...) |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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 |
This comment has been minimized.
This comment has been minimized.
|
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? |
This comment has been minimized.
This comment has been minimized.
|
IIRC label crashes are currently always resolved by appending |
beorn7
changed the title
Need to be able to collect metrics without adding an instance label
Need to be able to collect metrics without adding an instance (or job) label
Mar 17, 2015
This comment has been minimized.
This comment has been minimized.
|
As recently discussed in prometheus/pushgateway#18 , it looks we should have a directive |
beorn7
changed the title
Need to be able to collect metrics without adding an instance (or job) label
Need to be able to collect metrics without adding an instance (or job or exporter_instance or exporter_job) label
Mar 17, 2015
This comment has been minimized.
This comment has been minimized.
|
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 |
beorn7
assigned
fabxc
Jun 12, 2015
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
Aside from PGW, I haven't come across other servers using |
This comment has been minimized.
This comment has been minimized.
|
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. |
This comment has been minimized.
This comment has been minimized.
|
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). |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
|
Which is a good reason to make the precedence configurable. :) |
This comment has been minimized.
This comment has been minimized.
|
But yeah, two things to flip to set up pushgateway or federation is kind of meh... |
This comment has been minimized.
This comment has been minimized.
|
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 comment has been minimized.
This comment has been minimized.
|
This is resolved with the |
brian-brazil
closed this
Jul 1, 2015
simonpasquier
pushed a commit
to simonpasquier/prometheus
that referenced
this issue
Oct 12, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
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. |
brian-brazil commentedJan 30, 2015
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?