Skip to content

feat(anchor): expose Anchor Prometheus metrics on port 5164 - #46

Merged
ovidiu-ssv-labs merged 1 commit into
ssvlabs:mainfrom
shane-moore:anchor-metrics-port
Aug 11, 2026
Merged

feat(anchor): expose Anchor Prometheus metrics on port 5164#46
ovidiu-ssv-labs merged 1 commit into
ssvlabs:mainfrom
shane-moore:anchor-metrics-port

Conversation

@shane-moore

Copy link
Copy Markdown
Contributor

What this adds

Starts Anchor nodes with --metrics and publishes port 5164, so duty timing, head-event
trigger counters, and QBFT instrumentation are readable on a local run. SSV nodes already
publish theirs (port 9240, nodes/ssv/node.star); this closes that asymmetry and follows the
same shape there: module-level name/number constants plus a PortSpec in the ports dict.

16 lines in one file, no params or profile changes.

Why the explicit 0.0.0.0

Anchor defaults the metrics listen address to 127.0.0.1 (--metrics-address help: "Defaults
to 127.0.0.1 if --metrics is set"). Bound to loopback inside the container, the published port
refuses connections, so the bind has to be explicit.

Image compatibility

--metrics / --metrics-address / --metrics-port are present on every anchor image pinned in
this repo, checked against the shipped binaries rather than the source:

  • sigp/anchor:v1.3.0 (params.yaml, params-boole.yaml)
  • sigp/anchor:v1.2.0 (params-gloas.yaml)

Both default to port 5164. No profile regresses; profiles with anchor.count: 0 are unaffected
either way.

Verification

Live 4-operator all-Anchor run (ssv: 0 / anchor: 4):

  • kurtosis enclave inspect shows metrics: 5164/tcp on all four anchor-node-N, not just
    the bootnode (nodes 1..n inherit the flags via the existing list(command_arr) copy, and the
    ports dict is set on both service configs).
  • curl http://127.0.0.1:<mapped>/metrics returns HTTP 200 on all four, ~3,600 lines of
    Prometheus text each, carrying real Anchor families: anchor_execution_current_block,
    anchor_processor_work_event_queue_length, anchor_processor_worker_time_*.

Context

Extracted from #33 per @iurii-ssv's review. That PR's Gloas profiles are superseded by the work
merged since (#34, #35, #36, #37, #39, #40, #41), and this metrics change was one of the two
pieces identified as still net-new. The other, the buildoor external-builder profile, is left
out: it needs builder_count, which is absent from ethereum-package@6.1.0, and upstream still
starts genesis builders at actual_num_validators, colliding with the preregistered keyshare
validators at 64-73. That needs an upstream fix first rather than pinning this repo to a fork.

Anchor nodes started with no --metrics flag and no published port, so duty
timing, head-event trigger counters, and QBFT instrumentation were
unreadable on a local run. SSV nodes already publish theirs (port 9240);
this closes that asymmetry, following the same constant + PortSpec shape.

Anchor defaults the metrics listen address to 127.0.0.1, which is
unreachable from outside the container, hence the explicit 0.0.0.0 bind.

The flags exist on every anchor image pinned in this repo (verified against
the shipped binaries in sigp/anchor:v1.2.0 and :v1.3.0), so no profile
regresses.

Verified live on a 4-operator all-Anchor run: all four anchor-node-N publish
metrics: 5164/tcp, and each returns HTTP 200 with ~3.6k lines of Prometheus
text (anchor_execution_*, anchor_processor_*).
@ovidiu-ssv-labs
ovidiu-ssv-labs merged commit 76c02f6 into ssvlabs:main Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants