Skip to content

Commit 4371d71

Browse files
authored
refac: Adjust lido-exporter Grafana dashboard
* refac: Adjust lido-exporter Grafana dashboard * feat: Update lido-exporter penalty metrics * fix: Update test values
1 parent f1d4580 commit 4371d71

File tree

3 files changed

+71
-95
lines changed

3 files changed

+71
-95
lines changed

cmd/lido-exporter/metrics/metrics.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ func InitMetrics(nodeOperatorID, network string) {
4343
enqueuedKeysCountGauge.WithLabelValues(nodeOperatorID, network)
4444

4545
// Penalties metrics
46-
penaltiesTotal.WithLabelValues(nodeOperatorID, "", "")
46+
penaltiesTotal.WithLabelValues(nodeOperatorID, "el_rewards_stealing", "")
47+
penaltiesTotal.WithLabelValues(nodeOperatorID, "withdrawal", "")
48+
penaltiesTotal.WithLabelValues(nodeOperatorID, "initial_slashing", "")
4749

4850
// Exit requests metrics
4951
exitRequestsTotal.WithLabelValues(nodeOperatorID, network, "")

internal/lido/contracts/csmodule/nodeOperator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestNodeOperatorInfo(t *testing.T) {
6666
"Valid NodeID, Holesky", "holesky", big.NewInt(13), "0xC870Fd7316956C1582A2c8Fd2c42552cCEC70C88", false,
6767
},
6868
{
69-
"Valid Address, Holesky", "holesky", big.NewInt(4), "0xed1Fc097b5B9B007d40502e08aa0cddF477AaeaA", false,
69+
"Valid Address, Holesky", "holesky", big.NewInt(4), "0xbA99F374C20A3475De737B466ee68Ad9C38c26AF", false,
7070
},
7171
{
7272
"Invalid Address, Holesky", "holesky", big.NewInt(4), "0xC870Fd7316956C1582A2c8Fd2c46752cCEC70C99", true,

internal/monitoring/services/grafana/dashboards/lido-exporter/lido-exporter.json

Lines changed: 67 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -32,77 +32,6 @@
3232
},
3333
"id": 1,
3434
"panels": [],
35-
"title": "Node Operator Information",
36-
"type": "row"
37-
},
38-
{
39-
"datasource": {
40-
"type": "prometheus",
41-
"uid": "${DS_PROMETHEUS}"
42-
},
43-
"fieldConfig": {
44-
"defaults": {
45-
"color": {
46-
"mode": "thresholds"
47-
},
48-
"mappings": [],
49-
"thresholds": {
50-
"mode": "absolute",
51-
"steps": [
52-
{
53-
"color": "green",
54-
"value": null
55-
}
56-
]
57-
}
58-
},
59-
"overrides": []
60-
},
61-
"gridPos": {
62-
"h": 8,
63-
"w": 12,
64-
"x": 0,
65-
"y": 1
66-
},
67-
"id": 2,
68-
"options": {
69-
"colorMode": "value",
70-
"graphMode": "area",
71-
"justifyMode": "auto",
72-
"orientation": "auto",
73-
"reduceOptions": {
74-
"calcs": [
75-
"lastNotNull"
76-
],
77-
"fields": "",
78-
"values": false
79-
},
80-
"textMode": "auto"
81-
},
82-
"pluginVersion": "9.4.3",
83-
"targets": [
84-
{
85-
"datasource": {
86-
"type": "prometheus",
87-
"uid": "${DS_PROMETHEUS}"
88-
},
89-
"expr": "csm_node_operator_id",
90-
"refId": "A"
91-
}
92-
],
93-
"title": "Node Operator ID",
94-
"type": "stat"
95-
},
96-
{
97-
"collapsed": false,
98-
"gridPos": {
99-
"h": 1,
100-
"w": 24,
101-
"x": 0,
102-
"y": 9
103-
},
104-
"id": 3,
105-
"panels": [],
10635
"title": "Keys and Bonds Information",
10736
"type": "row"
10837
},
@@ -165,7 +94,7 @@
16594
"x": 0,
16695
"y": 10
16796
},
168-
"id": 4,
97+
"id": 2,
16998
"options": {
17099
"legend": {
171100
"calcs": [],
@@ -184,7 +113,7 @@
184113
"type": "prometheus",
185114
"uid": "${DS_PROMETHEUS}"
186115
},
187-
"expr": "csm_keys_stuck_validators_count",
116+
"expr": "csm_keys_stuck_validators_count{node_operator_id=\"${NODE_ID}\"}",
188117
"refId": "A",
189118
"legendFormat": "Stuck Validators"
190119
},
@@ -193,7 +122,7 @@
193122
"type": "prometheus",
194123
"uid": "${DS_PROMETHEUS}"
195124
},
196-
"expr": "csm_keys_refunded_validators_count",
125+
"expr": "csm_keys_refunded_validators_count{node_operator_id=\"${NODE_ID}\"}",
197126
"refId": "B",
198127
"legendFormat": "Refunded Validators"
199128
},
@@ -202,7 +131,7 @@
202131
"type": "prometheus",
203132
"uid": "${DS_PROMETHEUS}"
204133
},
205-
"expr": "csm_keys_exited_validators_count",
134+
"expr": "csm_keys_exited_validators_count{node_operator_id=\"${NODE_ID}\"}",
206135
"refId": "C",
207136
"legendFormat": "Exited Validators"
208137
},
@@ -211,7 +140,7 @@
211140
"type": "prometheus",
212141
"uid": "${DS_PROMETHEUS}"
213142
},
214-
"expr": "csm_keys_deposited_validators_count",
143+
"expr": "csm_keys_deposited_validators_count{node_operator_id=\"${NODE_ID}\"}",
215144
"refId": "D",
216145
"legendFormat": "Deposited Validators"
217146
},
@@ -220,7 +149,7 @@
220149
"type": "prometheus",
221150
"uid": "${DS_PROMETHEUS}"
222151
},
223-
"expr": "csm_keys_depositable_validators_count",
152+
"expr": "csm_keys_depositable_validators_count{node_operator_id=\"${NODE_ID}\"}",
224153
"refId": "E",
225154
"legendFormat": "Depositable Validators"
226155
}
@@ -288,7 +217,7 @@
288217
"x": 12,
289218
"y": 10
290219
},
291-
"id": 5,
220+
"id": 3,
292221
"options": {
293222
"legend": {
294223
"calcs": [],
@@ -307,7 +236,7 @@
307236
"type": "prometheus",
308237
"uid": "${DS_PROMETHEUS}"
309238
},
310-
"expr": "csm_bond_current / 1e18",
239+
"expr": "csm_bond_current{node_operator_id=\"${NODE_ID}\"} / 1e18",
311240
"refId": "A",
312241
"legendFormat": "Current Bond"
313242
},
@@ -316,7 +245,7 @@
316245
"type": "prometheus",
317246
"uid": "${DS_PROMETHEUS}"
318247
},
319-
"expr": "csm_bond_required / 1e18",
248+
"expr": "csm_bond_required{node_operator_id=\"${NODE_ID}\"} / 1e18",
320249
"refId": "B",
321250
"legendFormat": "Required Bond"
322251
},
@@ -325,7 +254,7 @@
325254
"type": "prometheus",
326255
"uid": "${DS_PROMETHEUS}"
327256
},
328-
"expr": "csm_bond_excess / 1e18",
257+
"expr": "csm_bond_excess{node_operator_id=\"${NODE_ID}\"} / 1e18",
329258
"refId": "C",
330259
"legendFormat": "Excess Bond"
331260
},
@@ -334,7 +263,7 @@
334263
"type": "prometheus",
335264
"uid": "${DS_PROMETHEUS}"
336265
},
337-
"expr": "csm_bond_missed / 1e18",
266+
"expr": "csm_bond_missed{node_operator_id=\"${NODE_ID}\"} / 1e18",
338267
"refId": "D",
339268
"legendFormat": "Missed Bond"
340269
}
@@ -350,7 +279,7 @@
350279
"x": 0,
351280
"y": 27
352281
},
353-
"id": 6,
282+
"id": 4,
354283
"panels": [],
355284
"title": "Rewards",
356285
"type": "row"
@@ -385,10 +314,10 @@
385314
"x": 0,
386315
"y": 28
387316
},
388-
"id": 7,
317+
"id": 5,
389318
"options": {
390319
"colorMode": "value",
391-
"graphMode": "area",
320+
"graphMode": "none",
392321
"justifyMode": "auto",
393322
"orientation": "auto",
394323
"reduceOptions": {
@@ -407,7 +336,7 @@
407336
"type": "prometheus",
408337
"uid": "${DS_PROMETHEUS}"
409338
},
410-
"expr": "csm_non_claimed_rewards / 1e18",
339+
"expr": "csm_non_claimed_rewards{node_operator_id=\"${NODE_ID}\"} / 1e18",
411340
"refId": "A"
412341
}
413342
],
@@ -422,7 +351,7 @@
422351
"x": 0,
423352
"y": 36
424353
},
425-
"id": 8,
354+
"id": 6,
426355
"panels": [],
427356
"title": "Penalties and Exit Requests",
428357
"type": "row"
@@ -490,7 +419,7 @@
490419
"x": 0,
491420
"y": 37
492421
},
493-
"id": 9,
422+
"id": 7,
494423
"options": {
495424
"legend": {
496425
"calcs": [],
@@ -509,12 +438,30 @@
509438
"type": "prometheus",
510439
"uid": "${DS_PROMETHEUS}"
511440
},
512-
"expr": "csm_onchain_penalties_total",
441+
"expr": "csm_onchain_penalties_total{node_operator_id=\"${NODE_ID}\", penalty_type=\"el_rewards_stealing\"}",
513442
"refId": "A",
514-
"legendFormat": "Penalties"
443+
"legendFormat": "EL Rewards Stealing"
444+
},
445+
{
446+
"datasource": {
447+
"type": "prometheus",
448+
"uid": "${DS_PROMETHEUS}"
449+
},
450+
"expr": "csm_onchain_penalties_total{node_operator_id=\"${NODE_ID}\", penalty_type=\"initial_slashing\"}",
451+
"refId": "B",
452+
"legendFormat": "Initial Slashing"
453+
},
454+
{
455+
"datasource": {
456+
"type": "prometheus",
457+
"uid": "${DS_PROMETHEUS}"
458+
},
459+
"expr": "csm_onchain_penalties_total{node_operator_id=\"${NODE_ID}\", penalty_type=\"withdrawal\"}",
460+
"refId": "C",
461+
"legendFormat": "Withdrawal"
515462
}
516463
],
517-
"title": "Penalties",
464+
"title": "Penalties by Type",
518465
"type": "timeseries"
519466
},
520467
{
@@ -580,7 +527,7 @@
580527
"x": 12,
581528
"y": 37
582529
},
583-
"id": 10,
530+
"id": 8,
584531
"options": {
585532
"legend": {
586533
"calcs": [],
@@ -599,7 +546,7 @@
599546
"type": "prometheus",
600547
"uid": "${DS_PROMETHEUS}"
601548
},
602-
"expr": "csm_onchain_exit_requests_total",
549+
"expr": "csm_onchain_exit_requests_total{node_operator_id=\"${NODE_ID}\"}",
603550
"refId": "A",
604551
"legendFormat": "Exit Requests"
605552
}
@@ -632,6 +579,33 @@
632579
"regex": "",
633580
"skipUrlSync": false,
634581
"type": "datasource"
582+
},
583+
{
584+
"current": {
585+
"selected": false,
586+
"text": "default",
587+
"value": "default"
588+
},
589+
"datasource": {
590+
"type": "prometheus",
591+
"uid": "${DS_PROMETHEUS}"
592+
},
593+
"definition": "label_values(csm_node_operator_id, node_operator_id)",
594+
"hide": 0,
595+
"includeAll": false,
596+
"label": "Node ID",
597+
"multi": false,
598+
"name": "NODE_ID",
599+
"options": [],
600+
"query": {
601+
"query": "label_values(csm_node_operator_id, node_operator_id)",
602+
"refId": "StandardVariableQuery"
603+
},
604+
"refresh": 1,
605+
"regex": "",
606+
"skipUrlSync": false,
607+
"sort": 0,
608+
"type": "query"
635609
}
636610
]
637611
},

0 commit comments

Comments
 (0)