From ae280f2b04b0413712a959a5678e130cc1176230 Mon Sep 17 00:00:00 2001 From: zloo Date: Thu, 4 Jan 2018 12:31:25 +0100 Subject: [PATCH] Add Prometheus 2.0 compatible example rules file - new YAML format (#739) --- example-rules.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 example-rules.yml diff --git a/example-rules.yml b/example-rules.yml new file mode 100644 index 00000000..5985287d --- /dev/null +++ b/example-rules.yml @@ -0,0 +1,14 @@ +groups: +- name: example-node-exporter-rules + 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) + + # CPU in use by CPU. + - record: instance_cpu:node_cpu_not_idle:rate5m + expr: sum(rate(node_cpu{mode!="idle"}[5m])) without (mode) + + # CPU in use by mode. + - record: instance_mode:node_cpu:rate5m + expr: sum(rate(node_cpu[5m])) without (cpu)