I want to count number of unique label values. Kind of like
select count (distinct a) from hello_info
For example if my metric \'hello_info\'
count(count by (a) (hello_info))
First you want an aggregator with a result per value of a
, and then you can count them.
Other example: If you want to count the number of apps deployed in a kubernetes cluster based on different values of a label( ex:app):
count(count(kube_pod_labels{app=~".*"}) by (app))