我正在使用 prometheus/grafana/express-prom-bundle 监控我的 nodejs 应用程序,它公开了一个名为 http_request_duration_seconds_count 的计数器指标。该指标具有三个感兴趣的标签。 status_code、路径和方法。
我想在我的 grafana 仪表板中显示一个表格,以列出仪表板日期范围内最常失败的路径/方法 (status_code="500")。
这可能吗?如果可能的话,我需要什么 prometheus 查询和 grafana 表设置来实现此列表。
预先感谢您的帮助。
最佳答案
这里你需要topk
聚合器,所以
topk(5,
sum by (method, path) (
rate(http_request_duration_seconds_count{status_code="500"}[5m])
)
)
关于monitoring - 你如何在 prometheus/grafana 表中显示大多数失败的 http 请求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44636513/