monitoring - 你如何在 prometheus/grafana 表中显示大多数失败的 http 请求?

标签 monitoring grafana health-monitoring prometheus

我正在使用 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/

相关文章:

java - Stagemonitor 相对于 JMX 监控的优势

c++ - 在 Visual Studio 中监视调用堆栈大小

azure - 如何在重定向 URI 中使用域名内的通配符 (Azure AD)

docker - custom.ini 被 Grafana docker 镜像忽略

monitoring - 如何获取某个时间间隔内指标的增量

docker - 健康状况为黄色的 Elasticsearch 索引

sd-card - 检查 SD 卡运行状况数据(如果有)

monitoring - 为 Grafana 选择后端数据库

tomcat - 监控每秒的tomcat请求?

java - 下游服务健康检查