admin管理员组文章数量:1296246
I have nginx ingress controller installed in Kubernetes cluster along with Prometheus and Grafana, I was exploring the Nginx Ingress controller dashboard that comes with the controller which has some very useful charts.
One chart that caught my attention is the service success rate which counts the percentage of requests that were successful (non 4xx or 5xx status codes returned). They count this metric as (simplified):
sum(rate(nginx_ingress_controller_requests{cluster=~"$cluster", status!~"[4-5].*"}[2m])) by (ingress)
/
sum(rate(nginx_ingress_controller_requests{cluster=~"$cluster"}[2m])) by (ingress)
I am confused why they would take the sum of the rate in this case instead of just summing over the counter nginx_ingress_controller_requests
, since by definition:
success rate = sum of successful requests/sum of total requests
It sounds more intutitive to drop the rate and sum over the counter. I would appreciate anyone who can help me understand this.
版权声明:本文标题:Calculating the success rate of nginx requests in Prometheus: sum of rate vs sum of counter - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741611989a2388313.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论