2
votes

I am monitoring my nodejs application using prometheus/grafana/express-prom-bundle which exposes a counter metric called http_request_duration_seconds_count. The metric has three labels of interest. status_code, path and method.

I would like to display a table in my grafana dashboard to list the most frequently failed paths/method (status_code="500") within the dashboard date range.

is that possible and if so what is prometheus query and grafana table settings that I need to achieve this list.

Thank you in advance for your help.

1

1 Answers

6
votes

Here you want the topk aggregator, so

topk(5, 
  sum by (method, path) (
    rate(http_request_duration_seconds_count{status_code="500"}[5m])
  )
)