2018-01-04 12:31:25 +01:00
|
|
|
groups:
|
|
|
|
- name: example-node-exporter-rules
|
|
|
|
rules:
|
|
|
|
# The count of CPUs per node, useful for getting CPU time as a percent of total.
|
2018-05-17 17:52:07 +02:00
|
|
|
- record: instance:node_cpus:count
|
2018-05-17 17:44:39 +02:00
|
|
|
expr: count(node_cpu_seconds_total{mode="idle"}) without (cpu,mode)
|
2018-01-04 12:31:25 +01:00
|
|
|
|
|
|
|
# CPU in use by CPU.
|
2018-05-17 17:52:07 +02:00
|
|
|
- record: instance_cpu:node_cpu_seconds_not_idle:rate5m
|
2018-05-17 17:44:39 +02:00
|
|
|
expr: sum(rate(node_cpu_seconds_total{mode!="idle"}[5m])) without (mode)
|
2018-01-04 12:31:25 +01:00
|
|
|
|
|
|
|
# CPU in use by mode.
|
2018-05-17 17:52:07 +02:00
|
|
|
- record: instance_mode:node_cpu_seconds:rate5m
|
2018-05-17 17:44:39 +02:00
|
|
|
expr: sum(rate(node_cpu_seconds_total[5m])) without (cpu)
|
2018-05-17 17:49:07 +02:00
|
|
|
|
|
|
|
# CPU in use ratio.
|
2018-05-17 18:15:07 +02:00
|
|
|
- record: instance:node_cpu_utilization:ratio
|
|
|
|
expr: sum(instance_mode:node_cpu_seconds:rate5m{mode!="idle"}) without (mode) / instance:node_cpus:count
|