Skip to content

Commit c968e97

Browse files
authored
app: add addr label to beacon node version (#4847)
* app/eth2wrap: add per beacon node request metrics with a bounded addr label Adds app_eth2_bn_requests_total, app_eth2_bn_errors_total and app_eth2_bn_first_total with endpoint and addr labels, recorded per beacon node inside provide, and an addr label on app_beacon_node_version. eth2wrap.BeaconNodeLabel keeps only scheme://host[:port], truncates to 64 characters, suffixes collisions with #n and caps distinct values at 16 (then "other"). The SSE listener uses it for its existing addr label so values join across metrics. Existing app_eth2_* metrics are unchanged. category: feature ticket: none * app/eth2wrap: restore gen header, split provide join loop, avoid http literal * app: drop per beacon node request counters, keep the addr label * app: use the existing redacted addr label, drop bnlabel
1 parent 10d405e commit c968e97

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎app/metrics.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ var (
8787
Namespace: "app",
8888
Subsystem: "beacon_node",
8989
Name: "version",
90-
Help: "Constant gauge with labels set to the version and beacon_id of the upstream beacon node",
91-
}, []string{"version", "beacon_id"})
90+
Help: "Constant gauge with labels set to the version, beacon_id and addr of the upstream beacon node",
91+
}, []string{"version", "beacon_id", "addr"})
9292

9393
executionEngineVersionGauge = promauto.NewResetGaugeVec(prometheus.GaugeOpts{
9494
Namespace: "app",

‎app/monitoringapi.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func consensusAndExecutionVersionMetric(ctx context.Context, eth2Cl eth2wrap.Cli
305305
continue
306306
}
307307

308-
beaconNodeVersionGauge.WithLabelValues(bnVersion, beaconID).Set(1)
308+
beaconNodeVersionGauge.WithLabelValues(bnVersion, beaconID, log.RedactURL(addr, true)).Set(1)
309309
eth2wrap.CheckBeaconNodeVersion(ctx, bnVersion)
310310

311311
if eeVersion != "" {

‎docs/metrics.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ when storing metrics from multiple nodes or clusters in one Prometheus instance.
2121
| `app_beacon_node_sse_dependent_root_mismatch_total` | Counter | Total number of head events whose duty dependent root differed from the cached attester duties, invalidating them | `addr` |
2222
| `app_beacon_node_sse_head_delay` | Histogram | Delay in seconds between slot start and head update, supplied by beacon node`s SSE endpoint. Values up to the end of the slot (12s for Ethereum mainnet) are considered safe. | `addr` |
2323
| `app_beacon_node_sse_head_slot` | Gauge | Current beacon node head slot, supplied by beacon node`s SSE endpoint | `addr` |
24-
| `app_beacon_node_version` | Gauge | Constant gauge with labels set to the version and beacon_id of the upstream beacon node | `version, beacon_id` |
24+
| `app_beacon_node_version` | Gauge | Constant gauge with labels set to the version, beacon_id and addr of the upstream beacon node | `version, beacon_id, addr` |
2525
| `app_builder_config_boost_factor_percent` | Gauge | The configured percentage multiplier applied to builder bid values. Absent when no builder URLs are configured. | |
2626
| `app_builder_config_max_execution_payment_gwei` | Gauge | The configured maximum execution layer payment in gwei counted when valuing a builder bid. Absent when no builder URLs are configured. | |
2727
| `app_builder_config_min_bid_gwei` | Gauge | The configured minimum builder bid value in gwei. Absent when no builder URLs are configured. | |

0 commit comments

Comments
 (0)