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 upTarget ordering inconsistent when using custom metrics path #4001
Comments
This comment has been minimized.
This comment has been minimized.
|
To clarify, do you have targets with identical target labels? |
This comment has been minimized.
This comment has been minimized.
|
Identical targets, unique A concrete example of a
|
This comment has been minimized.
This comment has been minimized.
|
That's not going to work out, every target needs a unique set of target labels or you'll have problems. I'll accept a change to sort by all target labels, but not one to sort by URL. |
This comment has been minimized.
This comment has been minimized.
|
What kinds of problems do you expect the above config to encounter? I've been running that structure for a week or so now and haven't noticed any issues aside from the broken ordering on the targets page. The scrape timings (and errors for some chronically failing targets) line up with expectations. I'm also unsure what you mean by Would the above config not simply result in two targets with meta labels of:
|
This comment has been minimized.
This comment has been minimized.
No it isn't, there's no label distinguishing those two targets. |
This comment has been minimized.
This comment has been minimized.
|
It seems we have different definitions of labels and targets here. There is very clearly a unique label for each target in my example json blob above, being the Not considering the path when comparing uniqueness but letting users modify it seems like an odd choice to me. To clarify, from everything I can see in metrics coming out this config renaming to unique paths 100% works in practice despite your assertions to the contrary. The only thing that appears to be broken is the sorting of the target list. Is there some component or expected behaviour somewhere that leads you to believe so strongly that this doesn't work. |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Right, now we're getting somewhere. So by The ie:
and
This is not that different to how snmp_exporter works, it just places the label uniqueness requirement in a different place (at the collector instead of in the targets list). Prometheus doesn't seem to care that my pre-scrape target label set isn't unique, it happily keeps the targets separate because they have different paths. I understand why it would be better to use query params like snmp_exporter does for this, but that ship has sailed. It's not like sorting the targets by full URL makes this footgun worse, it just makes it less annoying to look at the targets. |
This comment has been minimized.
This comment has been minimized.
|
That still doesn't make your setup sane, look more closely at what the snmp exporter does. |
This comment has been minimized.
This comment has been minimized.
|
agree -- it is not sane. Just think about your "up" metrics. |
klausenbusk
referenced this issue
Apr 29, 2018
Closed
file_sd_config: Support custom metrics_path #4121
This comment has been minimized.
This comment has been minimized.
|
This has gone stale, and I don't think there's anything we can do here. |
roganartu commentedMar 22, 2018
What did you do?
file_sd_configs, where each target inside the file has the sameinstancebut adds a unique__metrics_path__label (for proxying metrics to devices that can't run exporters, similar tosnmp_exporter)/targetsendpoint multiple timesWhat did you expect to see?
What did you see instead? Under which circumstances?
Cause
Sorting by only the
instancelabel: https://github.com/prometheus/prometheus/blob/master/web/web.go#L690-L694Proposal
Sort by the full URL (including query params, sorted by key?) instead of just the instance
Happy to do a PR for this is the proposal is acceptable.