Merge pull request #948 from prometheus/superq/rules

Update example rules
This commit is contained in:
Ben Kochie 2018-05-18 08:57:31 +02:00 committed by GitHub
commit 699b6d7f15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 13 deletions

View file

@ -3,12 +3,16 @@ groups:
rules:
# The count of CPUs per node, useful for getting CPU time as a percent of total.
- record: instance:node_cpus:count
expr: count(node_cpu{mode="idle"}) without (cpu,mode)
expr: count(node_cpu_seconds_total{mode="idle"}) without (cpu,mode)
# CPU in use by CPU.
- record: instance_cpu:node_cpu_not_idle:rate5m
expr: sum(rate(node_cpu{mode!="idle"}[5m])) without (mode)
- record: instance_cpu:node_cpu_seconds_not_idle:rate5m
expr: sum(rate(node_cpu_seconds_total{mode!="idle"}[5m])) without (mode)
# CPU in use by mode.
- record: instance_mode:node_cpu:rate5m
expr: sum(rate(node_cpu[5m])) without (cpu)
- record: instance_mode:node_cpu_seconds:rate5m
expr: sum(rate(node_cpu_seconds_total[5m])) without (cpu)
# CPU in use ratio.
- record: instance:node_cpu_utilization:ratio
expr: sum(instance_mode:node_cpu_seconds:rate5m{mode!="idle"}) without (mode) / instance:node_cpus:count

View file

@ -1,8 +0,0 @@
# The count of CPUs per node, useful for getting CPU time as a percent of total.
instance:node_cpus:count = count(node_cpu{mode="idle"}) without (cpu,mode)
# CPU in use by CPU.
instance_cpu:node_cpu_not_idle:rate5m = sum(rate(node_cpu{mode!="idle"}[5m])) without (mode)
# CPU in use by mode.
instance_mode:node_cpu:rate5m = sum(rate(node_cpu[5m])) without (cpu)