Skip to content

Commit

Permalink
Add revenue bridge alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Oct 26, 2023
1 parent e8f2742 commit 135f396
Show file tree
Hide file tree
Showing 3 changed files with 227 additions and 1 deletion.
73 changes: 73 additions & 0 deletions analytics/provisioning/alerting/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,79 @@ groups:
ping_harvesters: "true"
ping_strategists: "false"
isPaused: false
- uid: e917a303-934f-4c43-bfc4-ca161cf38f1d
title: Revenue bridge not harvested for too long
condition: revenue_bridge_harvested_recently_reduce
data:
- refId: revenue_bridge_harvested_recently
relativeTimeRange:
from: 86400
to: 0
datasourceUid: PAF11E62F20EEC83B
model:
editorMode: code
format: time_series
intervalMs: 1000
maxDataPoints: 43200
rawQuery: true
rawSql: "with revenue_bridge_harvested_chains as (\n select distinct chain\n from raw_revenue_bridge_harvest_report\n where $__timeFilter(datetime) \n),\nchains_harvested_recently as (\n select c.chain, rh.chain is not null as bridge_harvested_recently\n from chain c\n left join revenue_bridge_harvested_chains rh using (chain)\n where revenue_bridge_harvest_enabled\n)\nSELECT \n date_trunc('hour', now()) as time, \n chain,\n (not bridge_harvested_recently) :: integer as value\nFROM chains_harvested_recently\n;"
refId: revenue_bridge_harvested_recently
sql:
columns:
- parameters: []
type: function
groupBy:
- property:
type: string
type: groupBy
limit: 50
- refId: revenue_bridge_harvested_recently_reduce
relativeTimeRange:
from: 600
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 0
- 0
type: gt
operator:
type: and
query:
params: []
reducer:
params: []
type: avg
type: query
datasource:
name: Expression
type: __expr__
uid: __expr__
expression: revenue_bridge_harvested_recently
hide: false
intervalMs: 1000
maxDataPoints: 43200
reducer: last
refId: revenue_bridge_harvested_recently_reduce
settings:
mode: ""
type: reduce
dashboardUid: caae62be-8b27-4b99-9728-9685fd7b53c9
panelId: 1
noDataState: Alerting
execErrState: Error
for: 12h
annotations:
__dashboardUid__: caae62be-8b27-4b99-9728-9685fd7b53c9
__panelId__: "1"
labels:
ping_harvesters: "true"
ping_strategists: "false"
policy: follow_up
template: chain
isPaused: false


# List of alert rule UIDs that should be deleted
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 13,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "postgres",
"uid": "PAF11E62F20EEC83B"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"insertNulls": false,
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 13,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "postgres",
"uid": "PAF11E62F20EEC83B"
},
"editorMode": "code",
"format": "table",
"rawQuery": true,
"rawSql": "SELECT * \nFROM last_revenue_bridge_harvest_run_by_chain \nWHERE not run_ok\nand $__timeFilter(datetime) ",
"refId": "A",
"sql": {
"columns": [
{
"parameters": [],
"type": "function"
}
],
"groupBy": [
{
"property": {
"type": "string"
},
"type": "groupBy"
}
],
"limit": 50
}
}
],
"title": "Last Failed Revenue Bridge Harvests",
"type": "timeseries"
}
],
"refresh": "",
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Revenue Bridge Harvest Errors",
"uid": "caae62be-8b27-4b99-9728-9685fd7b53c9",
"version": 1,
"weekStart": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
}
}
],
"title": "Panel Title",
"title": "Unwrap failed reports",
"type": "table"
}
],
Expand Down

0 comments on commit 135f396

Please sign in to comment.