Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Metrics

We collect various metrics and serve them via a Prometheus-compatible HTTP endpoint at http://<http_address>:<metrics_port>/metrics (default: http://127.0.0.1:5054/metrics).

A ready-to-use Grafana + Prometheus monitoring stack with pre-configured leanMetrics dashboards is available in lean-quickstart.

The exposed metrics follow the leanMetrics specification, with some metrics not yet implemented. We have a full list of implemented metrics below, with a checkbox indicating whether each metric is currently supported or not.

Node Info Metrics

NameTypeUsageSample collection eventLabelsSupported
lean_node_infoGaugeNode information (always 1)On node startname, version
lean_node_start_time_secondsGaugeStart timestampOn node start

PQ Signature Metrics

NameTypeUsageSample collection eventLabelsBucketsSupported
lean_pq_sig_attestation_signatures_totalCounterTotal number of individual attestation signaturesOn each attestation signing
lean_pq_sig_attestation_signatures_valid_totalCounterTotal number of valid individual attestation signaturesOn each attestation signature verification
lean_pq_sig_attestation_signatures_invalid_totalCounterTotal number of invalid individual attestation signaturesOn each attestation signature verification
lean_pq_sig_attestation_signing_time_secondsHistogramTime taken to sign an attestationOn each attestation signing0.005, 0.01, 0.025, 0.05, 0.1, 1
lean_pq_sig_attestation_verification_time_secondsHistogramTime taken to verify an attestation signatureOn each attestation signature verification0.005, 0.01, 0.025, 0.05, 0.1, 1
lean_pq_sig_aggregated_signatures_totalCounterTotal number of aggregated signaturesOn aggregated signature production
lean_pq_sig_aggregated_signatures_valid_totalCounterTotal number of valid aggregated signaturesOn aggregated signature verification
lean_pq_sig_aggregated_signatures_invalid_totalCounterTotal number of invalid aggregated signaturesOn aggregated signature verification
lean_pq_sig_attestations_in_aggregated_signatures_totalCounterTotal number of attestations included into aggregated signaturesOn aggregated signature production
lean_pq_sig_aggregated_signatures_building_time_secondsHistogramTime taken to build an aggregated attestation signatureOn aggregated signature production0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 4
lean_pq_sig_aggregated_signatures_verification_time_secondsHistogramTime taken to verify an aggregated attestation signatureOn aggregated signature verification0.1, 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 4

Block Production Metrics

NameTypeUsageSample collection eventLabelsBucketsSupported
lean_block_aggregated_payloadsHistogramNumber of aggregated_payloads in a blockOn block production1, 2, 4, 8, 16, 32, 64, 128
lean_block_building_payload_aggregation_time_secondsHistogramTime taken to build aggregated_payloads during block buildingOn block production0.1, 0.25, 0.5, 0.75, 1, 2, 3, 4
lean_block_building_time_secondsHistogramTime taken to build a blockOn block production0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 0.75, 1
lean_block_building_success_totalCounterSuccessful block buildsOn block production
lean_block_building_failures_totalCounterFailed block builds (error building the block, signing the block root, or processing it locally)On block production failure
lean_block_proposal_attestation_build_phase_secondsHistogramPhase-level time in block-proposal attestation selectionOn block productionphase=select_payloads,compact,stf_simulate0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2, 4, 8
lean_block_proposal_attestation_builds_totalCounterAttestations selected during block-proposal selection (one per selection-loop round that picks an AttestationData)On each attestation selection
lean_block_proposal_child_payloads_consumed_totalCounterChild aggregated payloads selected during greedy proof picking (before compaction)On block production
lean_block_proposal_attestation_data_selectedHistogramDistinct AttestationData entries in the proposal block bodyOn block production0, 1, 2, 4, 8, 16, 32
lean_block_proposal_aggregates_selectedHistogramAggregated signature proofs in the proposal result after compactionOn block production0, 1, 2, 4, 8, 16, 32, 64, 128

Fork-Choice Metrics

NameTypeUsageSample collection eventLabelsBucketsSupported
lean_head_slotGaugeLatest slot of the lean chainOn get fork choice head
lean_current_slotGaugeCurrent slot of the lean chainOn scrape✅(*)
lean_safe_target_slotGaugeSafe target slotOn safe target update
lean_fork_choice_block_processing_time_secondsHistogramTime taken to process blockOn fork choice process block0.005, 0.01, 0.025, 0.05, 0.1, 1, 1.25, 1.5, 2, 4
lean_attestations_valid_totalCounterTotal number of valid attestationsOn validate attestation
lean_attestations_invalid_totalCounterTotal number of invalid attestationsOn validate attestation
lean_attestation_validation_time_secondsHistogramTime taken to validate attestationOn validate attestation0.005, 0.01, 0.025, 0.05, 0.1, 1
lean_fork_choice_reorgs_totalCounterTotal number of fork choice reorgsOn fork choice reorg
lean_fork_choice_reorg_depthHistogramDepth of fork choice reorgs (in blocks)On fork choice reorg1, 2, 3, 5, 7, 10, 20, 30, 50, 100
lean_tick_interval_duration_secondsHistogramElapsed time between clock ticks in secondsAt the start of each tick interval0.4, 0.6, 0.75, 0.8, 0.805, 0.81, 0.815, 0.82, 0.825, 0.85, 0.9, 1.0, 1.2, 1.6
lean_gossip_signaturesGaugeNumber of gossip signatures in fork-choice storeOn gossip signatures update
lean_latest_new_aggregated_payloadsGaugeNumber of new aggregated payload itemsOn latest_new_aggregated_payloads update
lean_latest_known_aggregated_payloadsGaugeNumber of known aggregated payload itemsOn latest_known_aggregated_payloads update
lean_committee_signatures_aggregation_time_secondsHistogramTime taken to aggregate committee signaturesOn committee signatures aggregation0.05, 0.1, 0.25, 0.5, 0.75, 1, 2, 3, 4
lean_node_sync_statusGaugeNode sync statusOn node sync status changestatus=idle,syncing,synced

State Transition Metrics

NameTypeUsageSample collection eventLabelsBucketsSupported
lean_latest_justified_slotGaugeLatest justified slotOn state transition
lean_latest_finalized_slotGaugeLatest finalized slotOn state transition
lean_justified_slotGaugeCurrent justified slotOn state transition
lean_finalized_slotGaugeCurrent finalized slotOn state transition
lean_finalizations_totalCounterTotal number of finalization attemptsOn finalization attemptresult=success,error
lean_state_transition_time_secondsHistogramTime to process state transitionOn state transition0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 2.5, 3, 4
lean_state_transition_slots_processed_totalCounterTotal number of processed slotsOn state transition process slots
lean_state_transition_slots_processing_time_secondsHistogramTime taken to process slotsOn state transition process slots0.005, 0.01, 0.025, 0.05, 0.1, 1
lean_state_transition_block_processing_time_secondsHistogramTime taken to process blockOn state transition process block0.005, 0.01, 0.025, 0.05, 0.1, 1
lean_state_transition_attestations_processed_totalCounterTotal number of processed attestationsOn state transition process attestations
lean_state_transition_attestations_processing_time_secondsHistogramTime taken to process attestationsOn state transition process attestations0.005, 0.01, 0.025, 0.05, 0.1, 1

Validator Metrics

NameTypeUsageSample collection eventLabelsBucketsSupported
lean_validators_countGaugeNumber of validators managed by a nodeOn scrape✅(*)
lean_is_aggregatorGaugeValidator’s is_aggregator status. True=1, False=0On node start
lean_attestations_production_time_secondsHistogramTime taken to produce attestationOn attestation production0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 0.75, 1

Network Metrics

NameTypeUsageSample collection eventLabelsSupported
lean_attestation_committee_countGaugeNumber of attestation committeesOn node start
lean_attestation_committee_subnetGaugeNode’s attestation committee subnetOn node start
lean_connected_peersGaugeNumber of connected peersOn scrapeclient=ethlambda,grandine,lantern,lighthouse,qlean,ream,zeam✅(*)
lean_gossip_mesh_peersGaugeNumber of peers in the gossipsub meshOn scrapeclient=<name>_<N>,unknown (ex. zeam_0)✅(*)
lean_peer_connection_events_totalCounterTotal number of peer connection eventsOn peer connectiondirection=inbound,outbound
result=success,timeout,error
lean_peer_disconnection_events_totalCounterTotal number of peer disconnection eventsOn peer disconnectiondirection=inbound,outbound
reason=timeout,remote_close,local_close,error

Custom Metrics (non-leanMetrics)

The metrics below are not part of the leanMetrics specification. They are ethlambda-specific observability around on-wire message sizes and post-quantum aggregated proof sizes.

PQ Signature Sizes

NameTypeUsageSample collection eventLabelsBuckets
lean_aggregated_proof_size_bytesHistogramBytes size of an aggregated signature proof’s proof_data fieldOn aggregated signature production1024, 4096, 16384, 65536, 131072, 262144, 524288, 1048576

Network Sizes

NameTypeUsageSample collection eventLabelsBuckets
lean_gossip_block_size_bytesHistogramBytes size of a gossip block message (raw SSZ or snappy on-wire)On gossip block send/receivecompression=raw,snappy10000, 50000, 100000, 250000, 500000, 1000000, 2000000, 5000000
lean_gossip_attestation_size_bytesHistogramBytes size of a gossip attestation message (raw SSZ or snappy on-wire)On gossip attestation send/receivecompression=raw,snappy512, 1024, 2048, 4096, 8192, 16384
lean_gossip_aggregation_size_bytesHistogramBytes size of a gossip aggregated attestation message (raw SSZ or snappy on-wire)On gossip aggregation send/receivecompression=raw,snappy1024, 4096, 16384, 65536, 131072, 262144, 524288, 1048576
lean_reqresp_request_size_bytesHistogramBytes size of a req/resp request (raw SSZ or snappy on-wire)On req/resp request send/receiveprotocol=status,blocks_by_root
compression=raw,snappy
64, 128, 256, 512, 1024, 4096, 16384, 65536
lean_reqresp_response_chunk_size_bytesHistogramBytes size of a single req/resp response chunk (raw SSZ or snappy on-wire)On req/resp response chunk send/receiveprotocol=status,blocks_by_root
compression=raw,snappy
128, 1024, 10000, 100000, 500000, 1000000, 5000000, 10000000

Storage

NameTypeUsageSample collection eventLabels
lean_table_bytesGaugeEstimated byte size of a storage table (key + value bytes)After each processed block (one update per table); retains its previous value on empty slotstable=<table_name>

Attestation Aggregate Coverage

Observability into how many validators/subnets are covered by the attestations the node has aggregated, broken down by pipeline section (the section label). The slot is the X-axis. These are sampled roughly once per slot, but emission is gated by the section’s source data, so a gauge can retain its previous value:

  • timely, late, block, combined and the diff_validators directions are emitted on block import, and only when the canonical head block carries that round’s votes (otherwise the round is skipped and prior values are kept).
  • agg_start_new is emitted at interval 2, right before fork-choice aggregation runs.
  • proposal_combined is emitted only when this node proposes a block.
NameTypeUsageSample collection eventLabels
lean_attestation_aggregate_coverage_validatorsGaugeValidator coverage in attestation aggregate reportsPer round, per section (see note above)section=timely,late,block,combined,agg_start_new,proposal_combined
subnet=combined,subnet_0,subnet_1,…,subnet_N-1
lean_attestation_aggregate_coverage_subnetsGaugeNumber of covered subnets in attestation aggregate reportsPer round, per section (see note above)section=timely,late,block,combined,agg_start_new,proposal_combined
lean_attestation_aggregate_coverage_diff_validatorsGaugeValidators in the symmetric difference between block-included aggregates and locally-aggregated timely aggregates for the same slotOn block import, when the head carries the round’s votes (see note above)direction=block_only,timely_only

✅(*) Partial support: These metrics are implemented but not collected “on scrape” as the spec requires. They are updated on specific events (e.g., on tick, on block processing) rather than being computed fresh on each Prometheus scrape.

Troubleshooting

Docker Desktop on MacOS

lean-quickstart uses the host network mode for Docker containers, which is a problem on MacOS. To work around this, enable the “Enable host networking” option in Docker Desktop settings under Resources > Network.