Skip to content

Commit

Permalink
refac: Adjust lido-exporter Grafana dashboard
Browse files Browse the repository at this point in the history
* refac: Adjust lido-exporter Grafana dashboard

* feat: Update lido-exporter penalty metrics

* fix: Update test values
  • Loading branch information
khalifaa55 authored Oct 7, 2024
1 parent f1d4580 commit 4371d71
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 95 deletions.
4 changes: 3 additions & 1 deletion cmd/lido-exporter/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ func InitMetrics(nodeOperatorID, network string) {
enqueuedKeysCountGauge.WithLabelValues(nodeOperatorID, network)

// Penalties metrics
penaltiesTotal.WithLabelValues(nodeOperatorID, "", "")
penaltiesTotal.WithLabelValues(nodeOperatorID, "el_rewards_stealing", "")
penaltiesTotal.WithLabelValues(nodeOperatorID, "withdrawal", "")
penaltiesTotal.WithLabelValues(nodeOperatorID, "initial_slashing", "")

// Exit requests metrics
exitRequestsTotal.WithLabelValues(nodeOperatorID, network, "")
Expand Down
2 changes: 1 addition & 1 deletion internal/lido/contracts/csmodule/nodeOperator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestNodeOperatorInfo(t *testing.T) {
"Valid NodeID, Holesky", "holesky", big.NewInt(13), "0xC870Fd7316956C1582A2c8Fd2c42552cCEC70C88", false,
},
{
"Valid Address, Holesky", "holesky", big.NewInt(4), "0xed1Fc097b5B9B007d40502e08aa0cddF477AaeaA", false,
"Valid Address, Holesky", "holesky", big.NewInt(4), "0xbA99F374C20A3475De737B466ee68Ad9C38c26AF", false,
},
{
"Invalid Address, Holesky", "holesky", big.NewInt(4), "0xC870Fd7316956C1582A2c8Fd2c46752cCEC70C99", true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,77 +32,6 @@
},
"id": 1,
"panels": [],
"title": "Node Operator Information",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 1
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "9.4.3",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_node_operator_id",
"refId": "A"
}
],
"title": "Node Operator ID",
"type": "stat"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 9
},
"id": 3,
"panels": [],
"title": "Keys and Bonds Information",
"type": "row"
},
Expand Down Expand Up @@ -165,7 +94,7 @@
"x": 0,
"y": 10
},
"id": 4,
"id": 2,
"options": {
"legend": {
"calcs": [],
Expand All @@ -184,7 +113,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_keys_stuck_validators_count",
"expr": "csm_keys_stuck_validators_count{node_operator_id=\"${NODE_ID}\"}",
"refId": "A",
"legendFormat": "Stuck Validators"
},
Expand All @@ -193,7 +122,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_keys_refunded_validators_count",
"expr": "csm_keys_refunded_validators_count{node_operator_id=\"${NODE_ID}\"}",
"refId": "B",
"legendFormat": "Refunded Validators"
},
Expand All @@ -202,7 +131,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_keys_exited_validators_count",
"expr": "csm_keys_exited_validators_count{node_operator_id=\"${NODE_ID}\"}",
"refId": "C",
"legendFormat": "Exited Validators"
},
Expand All @@ -211,7 +140,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_keys_deposited_validators_count",
"expr": "csm_keys_deposited_validators_count{node_operator_id=\"${NODE_ID}\"}",
"refId": "D",
"legendFormat": "Deposited Validators"
},
Expand All @@ -220,7 +149,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_keys_depositable_validators_count",
"expr": "csm_keys_depositable_validators_count{node_operator_id=\"${NODE_ID}\"}",
"refId": "E",
"legendFormat": "Depositable Validators"
}
Expand Down Expand Up @@ -288,7 +217,7 @@
"x": 12,
"y": 10
},
"id": 5,
"id": 3,
"options": {
"legend": {
"calcs": [],
Expand All @@ -307,7 +236,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_bond_current / 1e18",
"expr": "csm_bond_current{node_operator_id=\"${NODE_ID}\"} / 1e18",
"refId": "A",
"legendFormat": "Current Bond"
},
Expand All @@ -316,7 +245,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_bond_required / 1e18",
"expr": "csm_bond_required{node_operator_id=\"${NODE_ID}\"} / 1e18",
"refId": "B",
"legendFormat": "Required Bond"
},
Expand All @@ -325,7 +254,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_bond_excess / 1e18",
"expr": "csm_bond_excess{node_operator_id=\"${NODE_ID}\"} / 1e18",
"refId": "C",
"legendFormat": "Excess Bond"
},
Expand All @@ -334,7 +263,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_bond_missed / 1e18",
"expr": "csm_bond_missed{node_operator_id=\"${NODE_ID}\"} / 1e18",
"refId": "D",
"legendFormat": "Missed Bond"
}
Expand All @@ -350,7 +279,7 @@
"x": 0,
"y": 27
},
"id": 6,
"id": 4,
"panels": [],
"title": "Rewards",
"type": "row"
Expand Down Expand Up @@ -385,10 +314,10 @@
"x": 0,
"y": 28
},
"id": 7,
"id": 5,
"options": {
"colorMode": "value",
"graphMode": "area",
"graphMode": "none",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
Expand All @@ -407,7 +336,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_non_claimed_rewards / 1e18",
"expr": "csm_non_claimed_rewards{node_operator_id=\"${NODE_ID}\"} / 1e18",
"refId": "A"
}
],
Expand All @@ -422,7 +351,7 @@
"x": 0,
"y": 36
},
"id": 8,
"id": 6,
"panels": [],
"title": "Penalties and Exit Requests",
"type": "row"
Expand Down Expand Up @@ -490,7 +419,7 @@
"x": 0,
"y": 37
},
"id": 9,
"id": 7,
"options": {
"legend": {
"calcs": [],
Expand All @@ -509,12 +438,30 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_onchain_penalties_total",
"expr": "csm_onchain_penalties_total{node_operator_id=\"${NODE_ID}\", penalty_type=\"el_rewards_stealing\"}",
"refId": "A",
"legendFormat": "Penalties"
"legendFormat": "EL Rewards Stealing"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_onchain_penalties_total{node_operator_id=\"${NODE_ID}\", penalty_type=\"initial_slashing\"}",
"refId": "B",
"legendFormat": "Initial Slashing"
},
{
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_onchain_penalties_total{node_operator_id=\"${NODE_ID}\", penalty_type=\"withdrawal\"}",
"refId": "C",
"legendFormat": "Withdrawal"
}
],
"title": "Penalties",
"title": "Penalties by Type",
"type": "timeseries"
},
{
Expand Down Expand Up @@ -580,7 +527,7 @@
"x": 12,
"y": 37
},
"id": 10,
"id": 8,
"options": {
"legend": {
"calcs": [],
Expand All @@ -599,7 +546,7 @@
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"expr": "csm_onchain_exit_requests_total",
"expr": "csm_onchain_exit_requests_total{node_operator_id=\"${NODE_ID}\"}",
"refId": "A",
"legendFormat": "Exit Requests"
}
Expand Down Expand Up @@ -632,6 +579,33 @@
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": false,
"text": "default",
"value": "default"
},
"datasource": {
"type": "prometheus",
"uid": "${DS_PROMETHEUS}"
},
"definition": "label_values(csm_node_operator_id, node_operator_id)",
"hide": 0,
"includeAll": false,
"label": "Node ID",
"multi": false,
"name": "NODE_ID",
"options": [],
"query": {
"query": "label_values(csm_node_operator_id, node_operator_id)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
Expand Down

0 comments on commit 4371d71

Please sign in to comment.