How to visualise the results on grafana with cpu- memory usage metrics?

7/16/2021

How can I graph cpu and memory utilisation from prometheus on grafana?

I need to evaluate graphs based on these two metrics above, Where can I put this on grafana? Is it as a query?

I need to know how it works - any help with videos or articles?

-- L AL
cpu-usage
grafana
kubernetes
memory
prometheus

1 Answer

7/19/2021

First of all, you need to consider what specific metrics you want to display. Prometheus supports many of them:

  • Kubernetes Container CPU and Memory Usage
  • Kubernetes Pod CPU and Memory Usage
  • Kubernetes Node CPU and Memory Usage
  • Kubernetes Namespace CPU and Memory Usage
  • Kubernetes Cluster CPU and Memory Usage
  • Kubernetes Container CPU and Memory Requests
  • Kubernetes Pod CPU and Memory Requests
  • Kubernetes Node CPU and Memory Requests
  • Kubernetes Namespace CPU and Memory Requests
  • Kubernetes Cluster CPU and Memory Requests
  • Kubernetes Container CPU and Memory Limits
  • Kubernetes Pod CPU and Memory Limits
  • Kubernetes Node CPU and Memory Limits
  • Kubernetes Namespace CPU and Memory Limits
  • Kubernetes Cluster CPU and Memory Limits
  • Kubernetes Resource Capacity
  • Kubernetes CPU and Memory Request Commitment (Resource Requests vs Capacity)
  • Kubernetes CPU and Memory Limit Commitment (Resource Limits vs Capacity)
  • Kubernetes Resource Utilization (Resource Usage vs Capacity)
  • Kubernetes Resource Saturation

You can read about all these metrics, as well as the monitoring by prometheus itself, here. Once the prometheus collects and processes the appropriate metrics, you can take care of Grafana. You have to install it via Helm, for example, and then set port-forwarding to the appropriate pod. Then you will need to authenticate. When it comes to displaying Prometheus data, you need to create a new dashboard and then add a variable for Prometheus. Everything is fully described in this guide. You will find each step described, also with screenshots.

-- Mikołaj Głodziak
Source: StackOverflow