Example of indicator formula for prometheus monitoring CPU memory disk network

An example of an indicator formula for Prometheus monitoring CPU, memory, disk, and network can be as follows:

  1. CPU usage
100 - (avg by (instance) (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)
  1. memory usage
(node_memory_MemTotal - node_memory_MemFree - node_memory_Buffers - node_memory_Cached) / node_memory_MemTotal * 100
  1. disk space usage
100 - (node_filesystem_avail_bytes{mountpoint="/"} * 100 / node_filesystem_size_bytes{mountpoint="/"}) 
  1. Network traffic
irate(node_network_receive_bytes_total[5m]) + irate(node_network_transmit_bytes_total[5m])

The above formula is based on the default Prometheus monitoring indicators, and the specific indicator names may vary due to the use of different Exporters or nodes. It can be adjusted according to the actual situation.

Guess you like

Origin blog.csdn.net/a772304419/article/details/132000340