Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/blockchain/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,15 @@ static LEAN_BLOCK_BUILDING_PAYLOAD_AGGREGATION_TIME_SECONDS: std::sync::LazyLock
.unwrap()
});

// Widened past the leanMetrics bucket set: block builds regularly exceed its top bound,
// which collapsed every sample into `+Inf` and pinned the reported quantiles to that
// bound. The range mirrors the phase timings this metric encloses.
static LEAN_BLOCK_BUILDING_TIME_SECONDS: std::sync::LazyLock<Histogram> =
std::sync::LazyLock::new(|| {
register_histogram!(
"lean_block_building_time_seconds",
"Time taken to build a block",
vec![0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 0.75, 1.0]
vec![0.1, 0.25, 0.5, 0.75, 1.0, 2.0, 4.0, 8.0]
)
.unwrap()
});
Expand Down
8 changes: 7 additions & 1 deletion docs/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ The exposed metrics follow [the leanMetrics specification](https://github.com/le
|--------|-------|-------|-------------------------|--------|---------|-----------|
| `lean_block_aggregated_payloads` | Histogram | Number of `aggregated_payloads` in a block | On block production | | 1, 2, 4, 8, 16, 32, 64, 128 | βœ… |
| `lean_block_building_payload_aggregation_time_seconds` | Histogram | Time taken to build `aggregated_payloads` during block building | On block production | | 0.1, 0.25, 0.5, 0.75, 1, 2, 3, 4 | βœ… |
| `lean_block_building_time_seconds` | Histogram | Time taken to build a block | On block production | | 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 0.75, 1 | βœ… |
| `lean_block_building_time_seconds` | Histogram | Time taken to build a block | On block production | | 0.1, 0.25, 0.5, 0.75, 1, 2, 4, 8 | βœ… |
| `lean_block_building_success_total` | Counter | Successful block builds | On block production | | | βœ… |
| `lean_block_building_failures_total` | Counter | Failed block builds (error building the block, signing the block root, or processing it locally) | On block production failure | | | βœ… |
| `lean_block_proposal_attestation_build_phase_seconds` | Histogram | Phase-level time in block-proposal attestation selection | On block production | phase=select_payloads,compact,stf_simulate | 0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2, 4, 8 | βœ… |
Expand All @@ -45,6 +45,12 @@ The exposed metrics follow [the leanMetrics specification](https://github.com/le
| `lean_block_proposal_attestation_data_selected` | Histogram | Distinct `AttestationData` entries in the proposal block body | On block production | | 0, 1, 2, 4, 8, 16, 32 | βœ… |
| `lean_block_proposal_aggregates_selected` | Histogram | Aggregated signature proofs in the proposal result after compaction | On block production | | 0, 1, 2, 4, 8, 16, 32, 64, 128 | βœ… |

> `lean_block_building_time_seconds` intentionally deviates from the leanMetrics bucket
> set, which tops out at 1s. Real builds on our devnets routinely run past that, so every
> sample landed in `+Inf` and `histogram_quantile` reported a flat 1s ceiling. The range
> now covers the same span as the `lean_block_proposal_attestation_build_phase_seconds`
> phases it contains.

## Fork-Choice Metrics

| Name | Type | Usage | Sample collection event | Labels | Buckets | Supported |
Expand Down
Loading