Skip to content
Merged
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
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ struct Args {
async fn main() {
tracing_subscriber::fmt::init();

// Initialize Prometheus recorder
let builder = PrometheusBuilder::new();
// Initialize Prometheus recorder with histogram buckets
// Using set_buckets makes the exporter emit true Prometheus histograms (_bucket/_sum/_count)
// instead of summaries, which is required for histogram_quantile() in Grafana.
let builder = PrometheusBuilder::new()
.set_buckets(&[0.001, 0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1.0, 2.5, 5.0, 10.0])
.expect("failed to set histogram buckets");
let handle = builder
.install_recorder()
.expect("failed to install Prometheus recorder");
Expand Down