diff --git a/prometheus/alerts.rules.yml b/prometheus/alerts.rules.yml index 361d033..a5b548c 100644 --- a/prometheus/alerts.rules.yml +++ b/prometheus/alerts.rules.yml @@ -64,6 +64,7 @@ groups: for: 5m labels: severity: warning + group: API annotations: summary: "Time since the last update is too high" description: "The time since the last update for {{ $labels.pair }} has exceeded 1800 seconds." @@ -72,6 +73,7 @@ groups: for: 5m labels: severity: warning + group: API annotations: summary: "Price deviation is too high" description: "The price deviation of {{ $labels.pair }} from DefiLlama has exceeded 2.5%." @@ -80,6 +82,7 @@ groups: for: 5m labels: severity: critical + group: API annotations: summary: "Too few sources" description: "The number of sources for {{ $labels.pair }} has fallen below 1." @@ -88,6 +91,7 @@ groups: for: 5m labels: severity: critical + group: API annotations: summary: "Sequencer deviation is too high" description: "The ETH/STRK price has deviated from the sequencer price by more than 2%." diff --git a/src/processing/common.rs b/src/processing/common.rs index ea0393e..8aa5853 100644 --- a/src/processing/common.rs +++ b/src/processing/common.rs @@ -121,11 +121,11 @@ pub async fn query_pragma_api( ) -> Result { let request_url = match network_env { "Testnet" => format!( - "https://api.dev.pragma.build/node/v1/data/{pair}?routing=true", + "https://api.dev.pragma.build/node/v1/data/{pair}?aggregation=median&interval=1min&routing=true", pair = pair, ), "Mainnet" => format!( - "https://api.prod.pragma.build/node/v1/data/{pair}?routing=true", + "https://api.prod.pragma.build/node/v1/data/{pair}?aggregation=median&interval=1min&routing=true", pair = pair, ), _ => panic!("Invalid network env"),