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 upMultiple relabel configs with action: keep results in all metrics being dropped #3996
Comments
This comment has been minimized.
This comment has been minimized.
|
Do you have a proposal? |
This comment has been minimized.
This comment has been minimized.
|
edited to add proposal |
This comment has been minimized.
This comment has been minimized.
|
That's a breaking change, which we can't do and would cause confusion. It's also a complete change in semantics for how actions work, as they're currently independent. If you want multiple keeps ORed together, you can already combine them into one action (and it's probably more efficient too). |
brian-brazil
closed this
Apr 3, 2018
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 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. |
lock
bot
locked and limited conversation to collaborators
Mar 22, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
roganartu commentedMar 21, 2018
•
edited
Problem
The following set of relabel rules results in all metrics being dropped:
According to the documentation, this behaviour is entirely expected and technically correct, but I don't think it's very user-friendly.
The relabel function only looks at a single config at a time, so the first rule drops everything that matches the second, and the second drops everything that matches the first: https://github.com/prometheus/prometheus/blob/master/relabel/relabel.go#L40
Workaround
However this obviously quickly becomes cumbersome with any kind of complexity in regex and/or source labels, eg: for a (likely to grow and change over time) whitelist of metric-label combinations in
remote_write.Proposal
Make
action: keepbehaviour more consistent with it being the conceptual inverse ofaction: dropby keeping all metrics that match anyaction: keepconfig, not just those that match both. I think thataction: keepconfigs OR'd together are likely more useful than the existing AND behaviour, but I have no data to back that up.This breaks existing behaviour in two obvious ways, and perhaps more subtle ways:
action: keepconfigs together instead of a single long one will no longer work)action: keepconfigs together either before or after other relabel rules are applied. This will break configs that rely on order to work correctly (eg: using an initialaction: keepfollowed by other configs that assume metrics to have been dropped).