Skip to content

Commit

Permalink
fix: alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
EvolveArt committed Dec 20, 2023
1 parent f27d23f commit a7435b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 47 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,3 @@ OPSGENIE_API_KEY=
In order for the full flow to work you will need to have tables following the table schemas defined <a href="src/schema.rs">here</a>.

You can use our [indexer service](https://github.com/Astraly-Labs/indexer-service) on this repository to spin off your indexer in a few commands very easily.






46 changes: 5 additions & 41 deletions prometheus/alerts.rules.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,32 @@
groups:

- name: Oracle - Mainnet
- name: Oracle
rules:
- alert: TimeSinceLastUpdateTooHigh
expr: time_since_last_update_seconds{network="mainnet"} > 1200
expr: time_since_last_update_seconds > 1200
for: 5m
labels:
severity: critical
annotations:
summary: "Time since the last update is too high"
description: "The time since the last update from {{ $labels.publisher }} has exceeded 1200 seconds."
- alert: WrongPrice
expr: price_deviation{network="mainnet"} > 0.02
expr: price_deviation > 0.02
for: 5m
labels:
severity: critical
annotations:
summary: "Price deviation is too high"
description: "The price deviation of {{ $labels.pair }} from {{ $labels.source }} has exceeded 5%."
- alert: TooFewSources
expr: num_sources{network="mainnet"} < 5
expr: num_sources < 5
for: 5m
labels:
severity: critical
annotations:
summary: "Too few sources"
description: "The number of sources for {{ $labels.pair }} has fallen below 5."
- alert: SourceDeviation
expr: price_deviation_source{network="mainnet"} > 0.02
for: 5m
labels:
severity: critical
annotations:
summary: "Source deviation is too high"
description: "The source deviation of {{ $labels.pair }} from {{ $labels.source }} has exceeded 5%."

- name: Oracle - Testnet
rules:
- alert: TimeSinceLastUpdateTooHigh
expr: time_since_last_update_seconds{network="testnet"} > 1200
for: 5m
labels:
severity: warning
annotations:
summary: "Time since the last update is too high"
description: "The time since the last update from {{ $labels.publisher }} has exceeded 1200 seconds."
- alert: WrongPrice
expr: price_deviation{network="testnet"} > 0.02
for: 5m
labels:
severity: critical
annotations:
summary: "Price deviation is too high"
description: "The price deviation of {{ $labels.pair }} from {{ $labels.source }} has exceeded 5%."
- alert: TooFewSources
expr: num_sources{network="testnet"} < 5
for: 5m
labels:
severity: critical
annotations:
summary: "Too few sources"
description: "The number of sources for {{ $labels.pair }} has fallen below 5."
- alert: SourceDeviation
expr: price_deviation_source{network="testnet"} > 0.02
expr: price_deviation_source > 0.02
for: 5m
labels:
severity: critical
Expand Down

0 comments on commit a7435b1

Please sign in to comment.