Skip to content

Commit a39614d

Browse files
committed
docs: add document explaining metrics setup
1 parent ac65f6a commit a39614d

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

docs/metrics.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Metrics
2+
3+
We collect various metrics and serve them via a Prometheus-compatible HTTP endpoint at `http://<metrics_address>:<metrics_port>/metrics` (default: `http://127.0.0.1:5054/metrics`).
4+
5+
The exposed metrics follow [the leanMetrics specification](https://github.com/leanEthereum/leanMetrics/blob/3b32b300cca5ed7a7a2b3f142273fae9dbc171bf/metrics.md), 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.
6+
7+
## Node Info Metrics
8+
9+
| Name | Type | Usage | Sample collection event | Labels | Supported |
10+
|--------|-------|-------|-------------------------|--------|---------------|
11+
| `lean_node_info` | Gauge | Node information (always 1) | On node start | name, version ||
12+
| `lean_node_start_time_seconds` | Gauge | Start timestamp | On node start | ||
13+
14+
15+
## PQ Signature Metrics
16+
17+
| Name | Type | Usage | Sample collection event | Labels | Buckets | Supported |
18+
|--------|-------|-------|-------------------------|--------|---------|-----------|
19+
| `lean_pq_sig_attestation_signing_time_seconds` | Histogram | Time taken to sign an attestation | On each attestation signing | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
20+
| `lean_pq_sig_attestation_verification_time_seconds` | Histogram | Time taken to verify an attestation signature | On each `signature.verify()` on an attestation | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
21+
| `lean_pq_sig_aggregated_signatures_total` | Counter | Total number of aggregated signatures | On `build_attestation_signatures()` | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
22+
| `lean_pq_sig_attestations_in_aggregated_signatures_total` | Counter | Total number of attestations included into aggregated signatures | On `build_attestation_signatures()` | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
23+
| `lean_pq_sig_attestation_signatures_building_time_seconds` | Histogram | Time taken to verify an aggregated attestation signature | On `build_attestation_signatures()` | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
24+
| `lean_pq_sig_aggregated_signatures_verification_time_seconds` | Histogram | Time taken to verify an aggregated attestation signature | On validate aggregated signature | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
25+
| `lean_pq_sig_aggregated_signatures_valid_total`| Counter | Total number of valid aggregated signatures | On validate aggregated signature | | ||
26+
| `lean_pq_sig_aggregated_signatures_invalid_total`| Counter | Total number of invalid aggregated signatures | On validate aggregated signature | | ||
27+
28+
## Fork-Choice Metrics
29+
30+
| Name | Type | Usage | Sample collection event | Labels | Buckets | Supported |
31+
|--------|-------|-------|-------------------------|--------|---------|-----------|
32+
| `lean_head_slot` | Gauge | Latest slot of the lean chain | On get fork choice head | | ||
33+
| `lean_current_slot` | Gauge | Current slot of the lean chain | On scrape | | ||
34+
| `lean_safe_target_slot` | Gauge | Safe target slot | On safe target update | | ||
35+
|`lean_fork_choice_block_processing_time_seconds`| Histogram | Time taken to process block | On fork choice process block | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
36+
|`lean_attestations_valid_total`| Counter | Total number of valid attestations | On validate attestation | source=block,gossip | ||
37+
|`lean_attestations_invalid_total`| Counter | Total number of invalid attestations | On validate attestation | source=block,gossip | ||
38+
|`lean_attestation_validation_time_seconds`| Histogram | Time taken to validate attestation | On validate attestation | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
39+
| `lean_fork_choice_reorgs_total` | Counter | Total number of fork choice reorgs | On fork choice reorg | | ||
40+
| `lean_fork_choice_reorg_depth` | Histogram | Depth of fork choice reorgs (in blocks) | On fork choice reorg | | 1, 2, 3, 5, 7, 10, 20, 30, 50, 100 ||
41+
42+
## State Transition Metrics
43+
44+
| Name | Type | Usage | Sample collection event | Labels | Buckets | Supported |
45+
|--------|-------|-------|-------------------------|--------|---------|-----------|
46+
| `lean_latest_justified_slot` | Gauge | Latest justified slot | On state transition | | ||
47+
| `lean_latest_finalized_slot` | Gauge | Latest finalized slot | On state transition | | ||
48+
| `lean_finalizations_total` | Counter | Total number of finalization attempts | On finalization attempt | result=success,error | ||
49+
|`lean_state_transition_time_seconds`| Histogram | Time to process state transition | On state transition | | 0.25, 0.5, 0.75, 1, 1.25, 1.5, 2, 2.5, 3, 4 ||
50+
|`lean_state_transition_slots_processed_total`| Counter | Total number of processed slots | On state transition process slots | | ||
51+
|`lean_state_transition_slots_processing_time_seconds`| Histogram | Time taken to process slots | On state transition process slots | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
52+
|`lean_state_transition_block_processing_time_seconds`| Histogram | Time taken to process block | On state transition process block | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
53+
|`lean_state_transition_attestations_processed_total`| Counter | Total number of processed attestations | On state transition process attestations | | ||
54+
|`lean_state_transition_attestations_processing_time_seconds`| Histogram | Time taken to process attestations | On state transition process attestations | | 0.005, 0.01, 0.025, 0.05, 0.1, 1 ||
55+
56+
## Validator Metrics
57+
58+
| Name | Type | Usage | Sample collection event | Labels | Supported |
59+
|--------|-------|-------|-------------------------|--------|-----------|
60+
|`lean_validators_count`| Gauge | Number of validators managed by a node | On scrape | ||
61+
62+
## Network Metrics
63+
64+
| Name | Type | Usage | Sample collection event | Labels | Supported |
65+
|--------|-------|-------|-------------------------|--------|-----------|
66+
|`lean_connected_peers`| Gauge | Number of connected peers | On scrape | client=lantern,qlean,ream,zeam ||
67+
|`lean_peer_connection_events_total`| Counter | Total number of peer connection events | On peer connection | direction=inbound,outbound<br>result=success,timeout,error ||
68+
|`lean_peer_disconnection_events_total`| Counter | Total number of peer disconnection events | On peer disconnection | direction=inbound,outbound<br>reason=timeout,remote_close,local_close,error ||

0 commit comments

Comments
 (0)