From d8e31f3ebd37d7f85b2905b679243fe8e10462a1 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Sat, 14 Jan 2017 14:31:40 +0100 Subject: [PATCH] Add an example rules file Add some useful examples for CPU metrics. --- example.rules | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 example.rules diff --git a/example.rules b/example.rules new file mode 100644 index 00000000..b98e3252 --- /dev/null +++ b/example.rules @@ -0,0 +1,8 @@ +# 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)