diff --git a/cmd/lido-exporter/metrics/metrics.go b/cmd/lido-exporter/metrics/metrics.go index e0518a06..9e6cca0e 100644 --- a/cmd/lido-exporter/metrics/metrics.go +++ b/cmd/lido-exporter/metrics/metrics.go @@ -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, "") diff --git a/internal/lido/contracts/csmodule/nodeOperator_test.go b/internal/lido/contracts/csmodule/nodeOperator_test.go index bb57cbdd..3af24639 100644 --- a/internal/lido/contracts/csmodule/nodeOperator_test.go +++ b/internal/lido/contracts/csmodule/nodeOperator_test.go @@ -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, diff --git a/internal/monitoring/services/grafana/dashboards/lido-exporter/lido-exporter.json b/internal/monitoring/services/grafana/dashboards/lido-exporter/lido-exporter.json index 7d5ad06e..2b576651 100644 --- a/internal/monitoring/services/grafana/dashboards/lido-exporter/lido-exporter.json +++ b/internal/monitoring/services/grafana/dashboards/lido-exporter/lido-exporter.json @@ -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" }, @@ -165,7 +94,7 @@ "x": 0, "y": 10 }, - "id": 4, + "id": 2, "options": { "legend": { "calcs": [], @@ -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" }, @@ -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" }, @@ -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" }, @@ -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" }, @@ -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" } @@ -288,7 +217,7 @@ "x": 12, "y": 10 }, - "id": 5, + "id": 3, "options": { "legend": { "calcs": [], @@ -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" }, @@ -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" }, @@ -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" }, @@ -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" } @@ -350,7 +279,7 @@ "x": 0, "y": 27 }, - "id": 6, + "id": 4, "panels": [], "title": "Rewards", "type": "row" @@ -385,10 +314,10 @@ "x": 0, "y": 28 }, - "id": 7, + "id": 5, "options": { "colorMode": "value", - "graphMode": "area", + "graphMode": "none", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { @@ -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" } ], @@ -422,7 +351,7 @@ "x": 0, "y": 36 }, - "id": 8, + "id": 6, "panels": [], "title": "Penalties and Exit Requests", "type": "row" @@ -490,7 +419,7 @@ "x": 0, "y": 37 }, - "id": 9, + "id": 7, "options": { "legend": { "calcs": [], @@ -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" }, { @@ -580,7 +527,7 @@ "x": 12, "y": 37 }, - "id": 10, + "id": 8, "options": { "legend": { "calcs": [], @@ -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" } @@ -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" } ] },