Use the following PromQL:
count_values("status", probe_http_status_code)
More info in Prometheus documentation here.
Answer from Marcelo Ávila de Oliveira on Stack OverflowCount and group by day based on label value
promql - How can I group labels in a Prometheus query? - Stack Overflow
Group by option in query for prometheus
How do I show the count of a specific group of metrics from a prometheus histogram? - Stack Overflow
How can I group labels in a Prometheus query?
How do I use the "group by" function with labels in Prometheus queries?
How do I use the "group by" function to aggregate metrics by label in Prometheus?
It's even easier
sum by (group) (my_metric)
Yes, you can you use label replace to group all the misc together:
sum by (new_group) (
label_replace(
label_replace(my_metric, "new_group", "$1", "group", ".+"),
"new_group", "misc", "group", "misc group.+"
)
)
The inner label_replace copies all values from group into new_group, the outer overwrites those which match "misc group.+" with "misc", and we then sum by the "new_group" label. The reason for using a new label is the series would no longer be unique if we just overwrote the "group" label, and the sum wouldn't work.
rate(rpc_request_duration_seconds_bucket{le="+Inf"}[1m])
- ignoring(le)
rate(rpc_request_duration_seconds_bucket{le="1.0"}[1m])
will return how many queries are going over 1s every second.
This is all queries, minus the queries that take less than or equal to one second.
You want to write something like
rate(rpc_request_duration_seconds_count [1m])
This will give you the requests per second in a (sliding) interval of 1 minute. See the Query functions doc of Prometheus.