From cbb2337438e8ff75f67e5bde59b8872b3fe31f6a Mon Sep 17 00:00:00 2001 From: sunlei Date: Mon, 13 Jan 2025 05:01:21 +0800 Subject: [PATCH] fix: formatting errors (#448) * fix: formatting errors * Update query format in rules.yml --------- Co-authored-by: Samuel Berthe --- _data/rules.yml | 5 +---- dist/rules/host-and-hardware/node-exporter.yml | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/_data/rules.yml b/_data/rules.yml index fa57247..eab61c2 100644 --- a/_data/rules.yml +++ b/_data/rules.yml @@ -242,10 +242,7 @@ groups: for: 5m - name: Host context switching high description: Context switching is growing on the node (twice the daily average during the last 15m) - query: | - (rate(node_context_switches_total[15m])/count without(mode,cpu) (node_cpu_seconds_total{mode="idle"})) - / - (rate(node_context_switches_total[1d])/count without(mode,cpu) (node_cpu_seconds_total{mode="idle"})) > 2 + query: '(rate(node_context_switches_total[15m])/count without(mode,cpu) (node_cpu_seconds_total{mode="idle"})) / (rate(node_context_switches_total[1d])/count without(mode,cpu) (node_cpu_seconds_total{mode="idle"})) > 2' severity: warning comments: | x2 context switches is an arbitrary number. diff --git a/dist/rules/host-and-hardware/node-exporter.yml b/dist/rules/host-and-hardware/node-exporter.yml index 6a465d9..a6adff1 100644 --- a/dist/rules/host-and-hardware/node-exporter.yml +++ b/dist/rules/host-and-hardware/node-exporter.yml @@ -176,10 +176,7 @@ groups: description: "Time spent in IO is too high on {{ $labels.instance }}. Check storage for issues.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" - alert: HostContextSwitchingHigh - expr: '(rate(node_context_switches_total[15m])/count without(mode,cpu) (node_cpu_seconds_total{mode="idle"})) -/ -(rate(node_context_switches_total[1d])/count without(mode,cpu) (node_cpu_seconds_total{mode="idle"})) > 2 -' + expr: '(rate(node_context_switches_total[15m])/count without(mode,cpu) (node_cpu_seconds_total{mode="idle"}))/(rate(node_context_switches_total[1d])/count without(mode,cpu) (node_cpu_seconds_total{mode="idle"})) > 2' for: 0m labels: severity: warning