diff --git a/crates/blockchain/src/metrics.rs b/crates/blockchain/src/metrics.rs index 41b70bd7..81d00c29 100644 --- a/crates/blockchain/src/metrics.rs +++ b/crates/blockchain/src/metrics.rs @@ -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 = 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() }); diff --git a/docs/metrics.md b/docs/metrics.md index 017dc9ea..10f274a3 100644 --- a/docs/metrics.md +++ b/docs/metrics.md @@ -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 | ✅ | @@ -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 |