2

I am looking for a way to count the unique label values and show each unique label count for each customer name. Here are my metrics. I need to get the count as apple=1, orange=1.

 customer_alerts(alertname="a", customername="apple")
 customer_alerts(alertname="b", customername="orange")
 customer_alerts(alertname="a", customername="apple")
 

I tried the below query and it is showing the total count as 2, but i would like to show the count map to each customer name. How can I do that?

Example: apple=1, orange=1

count(count by (alertname)(customer_alerts[24h])))

Please note I am using grafana to create the dashboard.

shilpaadvi
  • 21
  • 2

0 Answers0