Skip to content

[metrics] block_duration_seconds histogram uses default buckets — mismatched for BSC 3s block time #218

@obchain

Description

@obchain

Refs #50

File: crates/charon-metrics/src/lib.rs

Problem

charon_pipeline_block_duration_seconds histogram uses default Prometheus buckets (0.005s — 10s). BSC produces a block every ~3s. Pipeline duration of interest spans 50ms (idle) to 5s+ (overrun, per PR #42 #174). Default buckets give too much resolution at 5ms-100ms (irrelevant) and not enough at 1s-5s (the alert range).

Fix

Define buckets:

const BLOCK_DURATION_BUCKETS: &[f64] = &[
    0.05, 0.1, 0.25, 0.5,  // healthy
    1.0, 2.0,              // warning
    3.0,                   // BSC block time — alert threshold
    5.0, 10.0,             // overrun
];

Grafana SLO panel can then render p50/p95/p99 against the 3s line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglayer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p1-coreCore MVP scopestatus:readyScoped and ready to pick up

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions