From f00f3db08b61b9d43e4b2a1f5097616d4a20218e Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Thu, 17 May 2018 17:49:07 +0200 Subject: [PATCH] Add a CPU in-use recording example. Signed-off-by: Ben Kochie --- example-rules.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/example-rules.yml b/example-rules.yml index bf222d49..20a75bbc 100644 --- a/example-rules.yml +++ b/example-rules.yml @@ -12,3 +12,7 @@ groups: # CPU in use by mode. - record: instance_mode:node_cpu_seconds_total:rate5m expr: sum(rate(node_cpu_seconds_total[5m])) without (cpu) + + # CPU in use ratio. + - record: instance:node_cpu_seconds_total_in_use:ratio + expr: sum(instance_mode:node_cpu_seconds_total:rate5m{mode!="idle"}) / instance:node_cpu_seconds_total:count