Skip to content

Commit b4460df

Browse files
authored
feat: testnet block height alerting on Grafana Cloud (#15311)
Fixes #14999
2 parents 5b58db8 + d2eb64d commit b4460df

19 files changed

+2011
-2
lines changed

.github/workflows/deploy-staging-networks.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,3 +256,12 @@ jobs:
256256
# the network env file and gcp credentials file are mounted into the ec2 instance
257257
# see ci3/bootstrap_ec2
258258
exec ./ci.sh network-deploy
259+
260+
- name: Update Monitoring App
261+
if: env.SEMVER != '' && env.MAJOR_VERSION == '2' && !contains(env.SEMVER, '-')
262+
env:
263+
MONITORING_NAMESPACE: testnet-block-height-monitor
264+
NAMESPACE: ${{ env.NAMESPACE }}
265+
run: |
266+
echo "Checking if monitoring app needs to be updated for testnet deployment..."
267+
./spartan/metrics/testnet-monitor/scripts/update-monitoring.sh ${{ env.NAMESPACE }} ${{ env.MONITORING_NAMESPACE }}

.github/workflows/testnet-deploy.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
REGION: us-west1-a
5151
TF_STATE_BUCKET: aztec-terraform
5252
GKE_CLUSTER_CONTEXT: "gke_testnet-440309_us-west1-a_aztec-gke-public"
53+
MONITORING_NAMESPACE: testnet-block-height-monitor
5354

5455
steps:
5556
- name: Checkout code
@@ -86,7 +87,7 @@ jobs:
8687
- name: Setup Terraform
8788
uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1
8889
with:
89-
terraform_version: "1.5.0"
90+
terraform_version: "1.5.0"
9091

9192
- name: Terraform Init
9293
working-directory: ./spartan/terraform/deploy-testnet
@@ -113,3 +114,8 @@ jobs:
113114
- name: Terraform Apply
114115
working-directory: ./spartan/terraform/deploy-testnet
115116
run: terraform apply -lock=${{ inputs.respect_tf_lock }} -auto-approve tfplan
117+
118+
- name: Update Monitoring App
119+
run: |
120+
echo "Checking if monitoring app needs to be updated for testnet deployment..."
121+
./spartan/metrics/testnet-monitor/scripts/update-monitoring.sh testnet ${{ env.MONITORING_NAMESPACE }}

spartan/metrics/.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
values.yaml
1+
./values.yaml
2+
.yarn/
3+
dist/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:18
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY . .
6+
7+
RUN corepack enable && yarn install
8+
9+
RUN yarn build
10+
11+
EXPOSE 8080
12+
13+
CMD ["node", "dist/index.js"]
Lines changed: 333 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,333 @@
1+
{
2+
"annotations": {
3+
"list": [
4+
{
5+
"builtIn": 1,
6+
"datasource": {
7+
"type": "grafana",
8+
"uid": "-- Grafana --"
9+
},
10+
"enable": true,
11+
"hide": true,
12+
"iconColor": "rgba(0, 211, 255, 1)",
13+
"name": "Annotations & Alerts",
14+
"type": "dashboard"
15+
}
16+
]
17+
},
18+
"editable": true,
19+
"fiscalYearStartMonth": 0,
20+
"graphTooltip": 0,
21+
"id": 17,
22+
"links": [],
23+
"panels": [
24+
{
25+
"datasource": {
26+
"type": "prometheus",
27+
"uid": "grafanacloud-prom"
28+
},
29+
"fieldConfig": {
30+
"defaults": {
31+
"color": {
32+
"mode": "palette-classic"
33+
},
34+
"custom": {
35+
"axisBorderShow": false,
36+
"axisCenteredZero": false,
37+
"axisColorMode": "text",
38+
"axisLabel": "",
39+
"axisPlacement": "auto",
40+
"barAlignment": 0,
41+
"barWidthFactor": 0.6,
42+
"drawStyle": "line",
43+
"fillOpacity": 0,
44+
"gradientMode": "none",
45+
"hideFrom": {
46+
"legend": false,
47+
"tooltip": false,
48+
"viz": false
49+
},
50+
"insertNulls": false,
51+
"lineInterpolation": "linear",
52+
"lineWidth": 1,
53+
"pointSize": 5,
54+
"scaleDistribution": {
55+
"type": "linear"
56+
},
57+
"showPoints": "auto",
58+
"spanNulls": false,
59+
"stacking": {
60+
"group": "A",
61+
"mode": "none"
62+
},
63+
"thresholdsStyle": {
64+
"mode": "off"
65+
}
66+
},
67+
"mappings": [],
68+
"thresholds": {
69+
"mode": "absolute",
70+
"steps": [
71+
{
72+
"color": "green",
73+
"value": 0
74+
},
75+
{
76+
"color": "red",
77+
"value": 80
78+
}
79+
]
80+
}
81+
},
82+
"overrides": []
83+
},
84+
"gridPos": {
85+
"h": 10,
86+
"w": 24,
87+
"x": 0,
88+
"y": 0
89+
},
90+
"id": 3,
91+
"options": {
92+
"legend": {
93+
"calcs": [],
94+
"displayMode": "list",
95+
"placement": "bottom",
96+
"showLegend": true
97+
},
98+
"tooltip": {
99+
"hideZeros": false,
100+
"mode": "single",
101+
"sort": "none"
102+
}
103+
},
104+
"pluginVersion": "12.1.0-89781",
105+
"targets": [
106+
{
107+
"editorMode": "code",
108+
"expr": "rollup_pending_block_number",
109+
"legendFormat": "Pending block height",
110+
"range": true,
111+
"refId": "A"
112+
},
113+
{
114+
"datasource": {
115+
"type": "prometheus",
116+
"uid": "grafanacloud-prom"
117+
},
118+
"disableTextWrap": false,
119+
"editorMode": "builder",
120+
"expr": "rollup_proven_block_number",
121+
"fullMetaSearch": false,
122+
"hide": false,
123+
"includeNullMetadata": true,
124+
"instant": false,
125+
"legendFormat": "Proven block height",
126+
"range": true,
127+
"refId": "B",
128+
"useBackend": false
129+
}
130+
],
131+
"title": "Pending Block Number",
132+
"type": "timeseries"
133+
},
134+
{
135+
"datasource": {
136+
"type": "prometheus",
137+
"uid": "grafanacloud-prom"
138+
},
139+
"fieldConfig": {
140+
"defaults": {
141+
"color": {
142+
"mode": "palette-classic"
143+
},
144+
"custom": {
145+
"axisBorderShow": false,
146+
"axisCenteredZero": false,
147+
"axisColorMode": "text",
148+
"axisLabel": "",
149+
"axisPlacement": "auto",
150+
"barAlignment": 0,
151+
"barWidthFactor": 0.6,
152+
"drawStyle": "line",
153+
"fillOpacity": 0,
154+
"gradientMode": "none",
155+
"hideFrom": {
156+
"legend": false,
157+
"tooltip": false,
158+
"viz": false
159+
},
160+
"insertNulls": false,
161+
"lineInterpolation": "linear",
162+
"lineWidth": 1,
163+
"pointSize": 5,
164+
"scaleDistribution": {
165+
"type": "linear"
166+
},
167+
"showPoints": "auto",
168+
"spanNulls": false,
169+
"stacking": {
170+
"group": "A",
171+
"mode": "none"
172+
},
173+
"thresholdsStyle": {
174+
"mode": "off"
175+
}
176+
},
177+
"mappings": [],
178+
"thresholds": {
179+
"mode": "absolute",
180+
"steps": [
181+
{
182+
"color": "green",
183+
"value": 0
184+
},
185+
{
186+
"color": "red",
187+
"value": 80
188+
}
189+
]
190+
}
191+
},
192+
"overrides": []
193+
},
194+
"gridPos": {
195+
"h": 11,
196+
"w": 12,
197+
"x": 0,
198+
"y": 10
199+
},
200+
"id": 2,
201+
"options": {
202+
"legend": {
203+
"calcs": [],
204+
"displayMode": "list",
205+
"placement": "bottom",
206+
"showLegend": true
207+
},
208+
"tooltip": {
209+
"hideZeros": false,
210+
"mode": "single",
211+
"sort": "none"
212+
}
213+
},
214+
"pluginVersion": "12.1.0-89781",
215+
"targets": [
216+
{
217+
"expr": "rollup_pending_block_number",
218+
"legendFormat": "{{job}}",
219+
"refId": "A"
220+
}
221+
],
222+
"title": "Pending Block Number",
223+
"type": "timeseries"
224+
},
225+
{
226+
"datasource": {
227+
"type": "prometheus",
228+
"uid": "grafanacloud-prom"
229+
},
230+
"fieldConfig": {
231+
"defaults": {
232+
"color": {
233+
"mode": "palette-classic"
234+
},
235+
"custom": {
236+
"axisBorderShow": false,
237+
"axisCenteredZero": false,
238+
"axisColorMode": "text",
239+
"axisLabel": "",
240+
"axisPlacement": "auto",
241+
"barAlignment": 0,
242+
"barWidthFactor": 0.6,
243+
"drawStyle": "line",
244+
"fillOpacity": 0,
245+
"gradientMode": "none",
246+
"hideFrom": {
247+
"legend": false,
248+
"tooltip": false,
249+
"viz": false
250+
},
251+
"insertNulls": false,
252+
"lineInterpolation": "linear",
253+
"lineWidth": 1,
254+
"pointSize": 5,
255+
"scaleDistribution": {
256+
"type": "linear"
257+
},
258+
"showPoints": "auto",
259+
"spanNulls": false,
260+
"stacking": {
261+
"group": "A",
262+
"mode": "none"
263+
},
264+
"thresholdsStyle": {
265+
"mode": "off"
266+
}
267+
},
268+
"mappings": [],
269+
"thresholds": {
270+
"mode": "absolute",
271+
"steps": [
272+
{
273+
"color": "green",
274+
"value": 0
275+
},
276+
{
277+
"color": "red",
278+
"value": 80
279+
}
280+
]
281+
}
282+
},
283+
"overrides": []
284+
},
285+
"gridPos": {
286+
"h": 11,
287+
"w": 12,
288+
"x": 12,
289+
"y": 10
290+
},
291+
"id": 1,
292+
"options": {
293+
"legend": {
294+
"calcs": [],
295+
"displayMode": "list",
296+
"placement": "bottom",
297+
"showLegend": true
298+
},
299+
"tooltip": {
300+
"hideZeros": false,
301+
"mode": "single",
302+
"sort": "none"
303+
}
304+
},
305+
"pluginVersion": "12.1.0-89781",
306+
"targets": [
307+
{
308+
"expr": "rollup_proven_block_number",
309+
"legendFormat": "{{job}}",
310+
"refId": "A"
311+
}
312+
],
313+
"title": "Proven Block Number",
314+
"type": "timeseries"
315+
}
316+
],
317+
"preload": false,
318+
"refresh": "",
319+
"schemaVersion": 41,
320+
"tags": [],
321+
"templating": {
322+
"list": []
323+
},
324+
"time": {
325+
"from": "now-6h",
326+
"to": "now"
327+
},
328+
"timepicker": {},
329+
"timezone": "browser",
330+
"title": "Alpha Testnet Block Height Monitor",
331+
"uid": "testnet-monitor",
332+
"version": 5
333+
}

0 commit comments

Comments
 (0)