From eb8dc736a3f136d4779621691966a51bc237bd85 Mon Sep 17 00:00:00 2001 From: Samuel Berthe Date: Mon, 4 May 2020 00:05:33 +0200 Subject: [PATCH] improve acuracy for context switching query --- _data/rules.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_data/rules.yml b/_data/rules.yml index c500425..9313e0c 100644 --- a/_data/rules.yml +++ b/_data/rules.yml @@ -169,7 +169,7 @@ groups: severity: warning - name: Host context switching description: Context switching is growing on node (> 1000 / s) - query: "rate(node_context_switches_total[5m]) > 1000" + query: "(rate(node_context_switches_total[5m])) / (count without(cpu, mode) (node_cpu_seconds_total{mode="idle"})) > 1000" severity: warning comments: | 1000 context switches is an arbitrary number.