fix(metrics): domain-scaled histogram buckets for block duration + profit#296
Closed
obchain wants to merge 1 commit intofeat/22-prometheus-metricsfrom
Closed
fix(metrics): domain-scaled histogram buckets for block duration + profit#296obchain wants to merge 1 commit intofeat/22-prometheus-metricsfrom
obchain wants to merge 1 commit intofeat/22-prometheus-metricsfrom
Conversation
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
Owner
Author
|
Commits moving onto feat/22-prometheus-metrics directly; no separate review surface. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
charon_pipeline_block_duration_seconds(BSC 3s cadence) andcharon_executor_profit_usd_cents(Venus profit range, $0.05 to $10k+).metrics-exporter-prometheus0.16 falls back to summary emission when no global buckets are set, not default histogram buckets (confirmed atdistribution.rs:119-122). Summaries feed neitherhistogram_quantilenor heatmaps, which produces the NaN quantile panels and empty heatmap the tracking issue describes.Root cause note
Issues #275/#217/#218 describe the symptom as "default HTTP-latency buckets". Under
metrics-exporter-prometheus0.16 the real mechanism is summary fallback, which has the same user-visible effect. The fix is unchanged either way.Bucket choices
charon_pipeline_block_duration_seconds:[0.05, 0.1, 0.25, 0.5, 1.0, 2.0, 3.0, 5.0, 10.0]- resolution packed around the 3s BSC block time (alert threshold) with healthy/warning/overrun tiers on either side.charon_executor_profit_usd_cents:[5, 50, 500, 2_500, 10_000, 50_000, 250_000, 1_000_000]- covers dust ($0.05) through windfall ($10k) per issue [metrics] profit_usd_cents histogram uses default Prometheus buckets — useless for Venus profit range #217.Test plan
cargo build -p charon-metricscleancargo test -p charon-metricspasses (init + helper smoke tests)cargo clippy -p charon-metrics --all-targets -- -D warningscleanCloses #275
Closes #218
Closes #217