From fe012aa6c234b699fa6830e7b474cef7bb44834f Mon Sep 17 00:00:00 2001 From: adel Date: Thu, 1 Aug 2024 14:59:15 +0200 Subject: [PATCH] hotfix: Fixed alert rules format (#38) * hotfix(alert_rules): Fixed alert rules format * hotfix(alert_rules): Lint :) --- prometheus/alerts.rules.yml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/prometheus/alerts.rules.yml b/prometheus/alerts.rules.yml index 4a26438..39bc8e6 100644 --- a/prometheus/alerts.rules.yml +++ b/prometheus/alerts.rules.yml @@ -64,7 +64,7 @@ groups: summary: "Price deviation is too high" description: "The median on-chain price of {{ $labels.pair }} has deviated for more than 2.5% with the reference price from DefiLlama." - - alert: LongTailAssetSourceDeviation + - alert: LongTailAssetIndividualSourceDeviation expr: | ( abs(long_tail_asset_source_deviation) > on(pair) group_left long_tail_asset_threshold{type="low"} @@ -81,14 +81,11 @@ groups: labels: severity: warning annotations: - summary: "Source deviation is too high" + summary: "Long tail asset individual source deviation is too high" description: | - {{ $total := long_tail_asset_total_sources }} - {{ $threshold := long_tail_asset_threshold{type="low"} }} - {{ if gt $total 6.0 }} - {{ $threshold = long_tail_asset_threshold{type="high"} }} - {{ end }} - Source {{ $labels.source }} for {{ $labels.pair }} ({{ $labels.type }}) has deviated from our price by {{ printf "%.2f" ($value * 100) }}%, which is beyond the threshold of {{ printf "%.2f" ($threshold * 100) }}%. + Source {{ $labels.source }} for {{ $labels.pair }} ({{ $labels.type }}) has deviated from our price by {{ $value }}. + Total sources: {{ $labels.total_sources }} + Threshold: {{ $labels.threshold }} - alert: LongTailAssetMultipleSourcesDeviation expr: | @@ -107,15 +104,9 @@ groups: labels: severity: critical annotations: - summary: "Too much sources have deviated" + summary: "Multiple long tail asset sources have deviated" description: | - {{ $deviating := count(abs(long_tail_asset_source_deviation) > on(pair) group_left long_tail_asset_threshold{type="low"}) by (network, pair, type) }} - {{ $total := long_tail_asset_total_sources }} - {{ $threshold := long_tail_asset_threshold{type="low"} }} - {{ if gt $total 6.0 }} - {{ $threshold = long_tail_asset_threshold{type="high"} }} - {{ end }} - {{ printf "%.0f" $deviating }} out of {{ printf "%.0f" $total }} sources for {{ $labels.pair }} ({{ $labels.type }}) have deviated from our price beyond {{ printf "%.2f" (100 * $threshold) }}%. + {{ $value }} sources for {{ $labels.pair }} ({{ $labels.type }}) have deviated from our price. - name: API rules: