From 48d9826c42d4f3a97ed0bcf5b671ec4f94453651 Mon Sep 17 00:00:00 2001 From: Ezhil Shanmugham Date: Fri, 13 Sep 2024 17:24:30 +0530 Subject: [PATCH] chore: update query_victoriametrics (#1892) Co-authored-by: Shahar Glazner --- examples/workflows/query_victoriametrics.yml | 35 ++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/examples/workflows/query_victoriametrics.yml b/examples/workflows/query_victoriametrics.yml index e4b3ad0d0..bfa5383c4 100644 --- a/examples/workflows/query_victoriametrics.yml +++ b/examples/workflows/query_victoriametrics.yml @@ -10,6 +10,37 @@ workflow: config: "{{ providers.victoriametrics }}" type: victoriametrics with: - query: process_memory_limit_bytes + query: avg(rate(process_cpu_seconds_total)) queryType: query - actions: [] + + actions: + - name: trigger-slack1 + condition: + - name: threshold-condition + type: threshold + value: "{{ steps.victoriametrics-step.results.data.result.0.value.1 }}" + compare_to: 0.0050 + alias: A + operator: ">" + provider: + type: slack + config: "{{ providers.slack }}" + with: + message: "Result: {{ steps.victoriametrics-step.results.data.result.0.value.1 }} is greater than 0.0040! 🚨" + + - name: trigger-slack2 + if: "{{ A }}" + provider: + type: slack + config: "{{ providers.slack }}" + with: + message: "Result: {{ steps.victoriametrics-step.results.data.result.0.value.1 }} is greater than 0.0040! 🚨" + + - name: trigger-ntfy + if: "{{ A }}" + provider: + type: ntfy + config: "{{ providers.ntfy }}" + with: + message: "Result: {{ steps.victoriametrics-step.results.data.result.0.value.1 }} is greater than 0.0040! 🚨" + topic: ezhil