作者:嘉信永顺_232 | 来源:互联网 | 2023-01-31 19:17
我正在使用prometheus/grafana/express-prom-bundle监视我的nodejs应用程序,它暴露了一个名为http_request_duration_seconds_count的计数器指标.该指标有三个感兴趣的标签.status_code,路径和方法.
我想在我的grafana仪表板中显示一个表,列出仪表板日期范围内最常见的失败路径/方法(status_code ="500").
是可能的,如果是这样,我需要实现此列表的prometheus查询和grafana表设置.
预先感谢您的帮助.
1> brian-brazil..:
在这里你想要topk
聚合器,所以
topk(5,
sum by (method, path) (
rate(http_request_duration_seconds_count{status_code="500"}[5m])
)
)