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 upIssue with count_values()? #1849
Comments
This comment has been minimized.
This comment has been minimized.
|
Check the documentation of the count_values(), there is a required parameter for specifying the label name which will hold the unique value. In you case, something like |
grobie
added
the
kind/question
label
Jul 27, 2016
This comment has been minimized.
This comment has been minimized.
|
Thank you! That did the job! It still isn't very clear to me though where exactly this is documented, but that probably is a fault on my part. I was looking at this page and following the logic here, to me it seemed that it could be used the same way as count() But again, this is probably a fault on my part. |
Hetkoekje
closed this
Jul 28, 2016
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. |
Hetkoekje commentedJul 27, 2016
Hi,
I've been using Prometheus with Cadvisor and node_exporter to monitor some dockers, currently i'm attempting to write a query to detect when a docker container goes down.
So far I've found this query that almost does the job to my liking:
count(container_last_seen{image!=""})This detects the amount of running containers nicely, but if prometheus is running and a docker goes down after prometheus is already running, the metric isn't removed.
This is cadvisor's part and maybe it is designed this way, because what i do notice is that the value of metric changes if the docker goes down!
Then I found the count_values() operator instead of the count() in the documentation of your website and was thinking, that's it!
Unfortunately, when I replaced count() with count_values() I received the following error:
count_values(container_last_seen{image!=""})Is this working as intended? If so, could you please clarify this a bit in your documentation and maybe put it in another category as count() or something? Because at this time, it seems like they can both be used in the same way (syntax wise).😄
If not, a bug is hereby reported