1

I would like to set an alert in prometheus when the usage of cpu is > 85%.

My host exposes this metrics.

process_cpu_seconds_total[5m])

How can I convert it into percentage cpu usage?

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
dname
  • 153
  • 2
  • 10

2 Answers2

2
irate(process_cpu_seconds_total{job="prometheus"}[5m]) * 100 / 2 (number of CPU cores)
-1
irate(process_cpu_seconds_total{job="prometheus"}[5m])*10
dbc
  • 104,963
  • 20
  • 228
  • 340