Search code examples
dockercpugrafanaprometheuscadvisor

Building CPU usage graph in Grafana for Docker container


I have connected cAdvisor -> Prometheus and Grafana to get graphs for my Docker containers. One of them is the CPU load, but i can only see the cumulative usage lines and not actually a value at the moment. Id love to see somethin similar cAdvisor is showing. Whts the way to do so?


Solution

  • You're looking for the irate() and rate() functions. Using irate(my_metric[5m]) will calculate the per-second value for you.