I need to create a PromQL query to select the most frequent metric value and display it in a Grafana panel; something like (Find most frequent value in SQL column)
In the following example, for metric status
with label job
,
I want to display in a panel status 1 (given count for 1
= 2, count for 2
= 1, count for 3
= 1) (and possibly use that 1
in Grafana, i.e., as a value in the Values Mapping section of a panel such as Polystat).
status(job="a") = 1
status(job="b") = 2
status(job="c") = 1
status(job="d") = 3