Skip to content

Commit

Permalink
fix: PromQL epxression for coredns average packet size (#43)
Browse files Browse the repository at this point in the history
The method for taking the average of a histogram metric is documented
here:
https://prometheus.io/docs/practices/histograms/#count-and-sum-of-observations
  • Loading branch information
geekofalltrades authored Apr 20, 2023
1 parent 3e71721 commit b796909
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dashboards/k8s-system-coredns.json
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
"uid": "${datasource}"
},
"exemplar": true,
"expr": "avg(rate(coredns_dns_request_size_bytes_sum{instance=~\"$instance\",proto=\"$protocol\"}[$__rate_interval])) by (proto)",
"expr": "sum(rate(coredns_dns_request_size_bytes_sum{instance=~\"$instance\",proto=\"$protocol\"}[$__rate_interval])) by (proto) / sum(rate(coredns_dns_request_size_bytes_count{instance=~\"$instance\",proto=\"$protocol\"}[$__rate_interval])) by (proto)",
"interval": "$resolution",
"legendFormat": "average $protocol packet size",
"refId": "A"
Expand Down Expand Up @@ -1553,6 +1553,6 @@
"timezone": "",
"title": "Kubernetes / System / CoreDNS",
"uid": "k8s_system_coredns",
"version": 11,
"version": 12,
"weekStart": ""
}

0 comments on commit b796909

Please sign in to comment.