I have the following Prometheus query with a gauge metric:
sum by (service, status) (service_results_total)
The metric is more granular and has other labels, that’s why aggregation is needed.
I’d like to generate a table where the service label is the row and the status label is the column using the data from the last time series available and also add the total in the end (where time series are grouped by service only)
So the result would look like this:
service | ok | fail | warning | total |
---|---|---|---|---|
service A | 3 | 1 | 4 | 8 |
service B | 1 | 4 | 1 | 6 |
service C | 0 | 1 | 4 | 5 |
I tried combinations of table panel, format and transformation but I couldn’t get to the result above.
Any help is appreciated, thanks a lot.