Skip to content

Commit

Permalink
hotfix: Fixed alert rules format (#38)
Browse files Browse the repository at this point in the history
* hotfix(alert_rules): Fixed alert rules format

* hotfix(alert_rules): Lint :)
  • Loading branch information
akhercha authored Aug 1, 2024
1 parent 1d0c6c4 commit fe012aa
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions prometheus/alerts.rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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: |
Expand All @@ -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:
Expand Down

0 comments on commit fe012aa

Please sign in to comment.