From ce34876b0e7783f4520c15d6979943dd75005621 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 9 May 2024 18:24:15 +0530 Subject: [PATCH] Add alert rule for sushiswap-v3 subgraph --- .../monitoring/subgraph-alert-rules.yml | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 stack_orchestrator/data/config/monitoring/subgraph-alert-rules.yml diff --git a/stack_orchestrator/data/config/monitoring/subgraph-alert-rules.yml b/stack_orchestrator/data/config/monitoring/subgraph-alert-rules.yml new file mode 100644 index 00000000..f1ceb21f --- /dev/null +++ b/stack_orchestrator/data/config/monitoring/subgraph-alert-rules.yml @@ -0,0 +1,79 @@ +apiVersion: 1 +groups: + - orgId: 1 + name: subgraph + folder: SubgraphAlerts + interval: 30s + rules: + - uid: b2a9144b-6104-46fc-92b5-352f4e643c4c + title: sushiswap_v3_subgraph_head_tracking + condition: condition + data: + - refId: latest_head + relativeTimeRange: + from: 600 + to: 0 + datasourceUid: PBFA97CFB590B2093 + model: + editorMode: code + expr: ethereum_chain_head_number{job="graph-node", network="filecoin"} + instant: true + intervalMs: 1000 + legendFormat: __auto + maxDataPoints: 43200 + range: false + refId: latest_head + - refId: diff + relativeTimeRange: + from: 600 + to: 0 + datasourceUid: PBFA97CFB590B2093 + model: + datasource: + type: prometheus + uid: PBFA97CFB590B2093 + editorMode: code + expr: ethereum_chain_head_number - on(network) group_right deployment_head{deployment="QmRPQM4ZtRJYr8WiNdg6oqKRNQHHXv5rZrD4gzqQrJpPhz"} + instant: true + intervalMs: 1000 + legendFormat: __auto + maxDataPoints: 43200 + range: false + refId: diff + - refId: condition + relativeTimeRange: + from: 600 + to: 0 + datasourceUid: __expr__ + model: + conditions: + - evaluator: + params: + - 15 + - 0 + type: gt + operator: + type: and + query: + params: [] + reducer: + params: [] + type: avg + type: query + datasource: + name: Expression + type: __expr__ + uid: __expr__ + expression: diff + intervalMs: 1000 + maxDataPoints: 43200 + refId: condition + type: threshold + noDataState: Alerting + execErrState: Alerting + for: 5m + annotations: + summary: Subgraph deployment {{ index $labels "deployment" }} is falling behind head by {{ index $values "diff" }} + labels: + latest_head: '{{ index $values "latest_head" }}' + isPaused: false