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 upWhy can't {} be used to match every metric? #2162
Comments
brian-brazil
added
the
kind/question
label
Nov 4, 2016
This comment has been minimized.
This comment has been minimized.
|
This is on purpose to reduce the chances of users accidentally hosing their Prometheus, as it's very easy to end up with such an expression while playing around. |
This comment has been minimized.
This comment has been minimized.
mprasil
commented
Nov 7, 2016
|
@EdSchouten use " |
brian-brazil
closed this
Jan 17, 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. |
lock
bot
locked and limited conversation to collaborators
Mar 24, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
EdSchouten commentedNov 4, 2016
I've noticed that Prometheus contains some smartness that prevents you from running queries that match every metric. For example, running the query
{}prints the following error:Let's add some smartness to work around this by running
{__name__=~".*"}:You could ask yourself: why would you want to run a query that matches every metric? Well, I just want to get a rough idea of the number of metrics our Prometheus setup stores by job. Ideally I'd just want to run
count({}) by (job), but now I'm forced to use workarounds likecount({__name__=~"..*"}) by (job)(notice the..*).