Skip to content

fix(metrics): domain-scaled histogram buckets for block duration + profit#296

Closed
obchain wants to merge 1 commit intofeat/22-prometheus-metricsfrom
fix/275-histogram-buckets
Closed

fix(metrics): domain-scaled histogram buckets for block duration + profit#296
obchain wants to merge 1 commit intofeat/22-prometheus-metricsfrom
fix/275-histogram-buckets

Conversation

@obchain
Copy link
Copy Markdown
Owner

@obchain obchain commented Apr 23, 2026

Summary

  • Register explicit Prometheus bucket boundaries on charon_pipeline_block_duration_seconds (BSC 3s cadence) and charon_executor_profit_usd_cents (Venus profit range, $0.05 to $10k+).
  • Without matchers, metrics-exporter-prometheus 0.16 falls back to summary emission when no global buckets are set, not default histogram buckets (confirmed at distribution.rs:119-122). Summaries feed neither histogram_quantile nor heatmaps, which produces the NaN quantile panels and empty heatmap the tracking issue describes.
  • Promotes both metrics back to histograms with domain-scaled buckets so Grafana Panel 2 (p50/p95 block duration) and Panel 8 (profit heatmap) render real quantiles on first scrape.

Root cause note

Issues #275/#217/#218 describe the symptom as "default HTTP-latency buckets". Under metrics-exporter-prometheus 0.16 the real mechanism is summary fallback, which has the same user-visible effect. The fix is unchanged either way.

Bucket choices

Test plan

Closes #275
Closes #218
Closes #217

Register explicit bucket boundaries for
charon_pipeline_block_duration_seconds and
charon_executor_profit_usd_cents via
PrometheusBuilder::set_buckets_for_metric. Without matchers, the
exporter renders both histograms as Prometheus summaries, producing
NaN from histogram_quantile and empty heatmaps in the companion
Grafana dashboard.

Block-duration buckets target BSC's 3s block cadence
(healthy / warning / alert / overrun). Profit buckets cover the
$0.05 dust to $10k+ windfall range observed on Venus liquidations.

Closes #275
Closes #218
Closes #217
@obchain
Copy link
Copy Markdown
Owner Author

obchain commented Apr 23, 2026

Commits moving onto feat/22-prometheus-metrics directly; no separate review surface.

@obchain obchain closed this Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant