From 4c757cbe097615fa18b97e122f7bc5d73a05f5ac Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 28 Oct 2024 15:15:52 +0000 Subject: [PATCH] feat: add metric to track default validator configuration (#7194) * Add metric to track default validator configuration * Update validator client dashboard * Rename column --- dashboards/lodestar_validator_client.json | 91 ++++++++++++++++++++++- packages/validator/src/metrics.ts | 10 +++ packages/validator/src/validator.ts | 2 + 3 files changed, 100 insertions(+), 3 deletions(-) diff --git a/dashboards/lodestar_validator_client.json b/dashboards/lodestar_validator_client.json index 5e4459d1d1b9..f954f0a04ccd 100644 --- a/dashboards/lodestar_validator_client.json +++ b/dashboards/lodestar_validator_client.json @@ -497,7 +497,7 @@ }, "gridPos": { "h": 3, - "w": 6, + "w": 3, "x": 12, "y": 2 }, @@ -552,8 +552,8 @@ }, "gridPos": { "h": 3, - "w": 6, - "x": 18, + "w": 3, + "x": 15, "y": 2 }, "id": 37, @@ -590,6 +590,91 @@ "title": "Heap used", "type": "stat" }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "center", + "cellOptions": { + "type": "color-text" + }, + "inspect": false + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 3, + "w": 6, + "x": 18, + "y": 2 + }, + "id": 48, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "enablePagination": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "10.4.1", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "exemplar": false, + "expr": "vc_default_configuration", + "format": "table", + "instant": true, + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Value": true, + "__name__": true, + "client_name": true, + "group": true, + "host_type": true, + "instance": true, + "job": true, + "network": true, + "scrape_location": true + }, + "includeByName": {}, + "indexByName": {}, + "renameByName": { + "broadcastValidation": "Broadcast validation", + "builderSelection": "Builder selection" + } + } + } + ], + "type": "table" + }, { "datasource": { "type": "prometheus", diff --git a/packages/validator/src/metrics.ts b/packages/validator/src/metrics.ts index ca693056fc54..1f49c038a50d 100644 --- a/packages/validator/src/metrics.ts +++ b/packages/validator/src/metrics.ts @@ -1,3 +1,4 @@ +import {routes} from "@lodestar/api"; import {MetricsRegisterExtra} from "@lodestar/utils"; export enum MessageSource { @@ -38,6 +39,15 @@ export function getMetrics(register: MetricsRegisterExtra, gitData: LodestarGitD .set(gitData, 1); return { + defaultConfiguration: register.gauge<{ + builderSelection: routes.validator.BuilderSelection; + broadcastValidation: routes.beacon.BroadcastValidation; + }>({ + name: "vc_default_configuration", + help: "Default validator configuration", + labelNames: ["builderSelection", "broadcastValidation"], + }), + // Attestation journey: // - Wait for block or 1/3, call prepare attestation // - Get attestation, sign, call publish diff --git a/packages/validator/src/validator.ts b/packages/validator/src/validator.ts index 1d370c35cc33..09a3a80062da 100644 --- a/packages/validator/src/validator.ts +++ b/packages/validator/src/validator.ts @@ -329,6 +329,8 @@ export class Validator { strictFeeRecipientCheck, }); + metrics?.defaultConfiguration.set({builderSelection: defaultBuilderSelection, broadcastValidation}, 1); + // Instantiates block and attestation services and runs them once the chain has been started. return Validator.init(opts, genesis, metrics); }