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 upPrometheus 2: Invalid characters in recording rule names are silently allowed (and break things) #3290
Comments
brian-brazil
added
component/rules
kind/bug
priority/P1
labels
Oct 13, 2017
brian-brazil
added this to the v2.x milestone
Oct 13, 2017
krasi-georgiev
referenced this issue
Oct 17, 2017
Merged
validates that the recording name to include only allowed characters. #3305
brian-brazil
closed this
in
#3305
Oct 17, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 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 23, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
EdSchouten commentedOct 13, 2017
•
edited
#So here I am, migrating a recording rule from Prometheus 1 to an instance running 2.0.0-rc0:
Prometheus 2 uses YAML. Let's try this?
Interesting: Prometheus starts properly and the rule gets displayed on the rules page. Yet, I can't seem to get any results when using simple queries like
banana. Well, as it turns out, the recording rule above introduces an actual metric with namebanana{color="yellow"}; notbanana. You end up with metrics along this shape:banana{color="yellow"}{flavor="sweet"}. The only way you can access them is if you use queries like{__name__=~"banana.*"}.Reading some more documentation, it looks like I need to do this instead:
Question: would it make sense to add some kind of safety belt to the recording rules parser to reject names that don't match
[a-zA-Z_:][a-zA-Z0-9_:]*?