Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jsonrpsee = "0.24.9"
http = "1.1.0"
metrics = "0.24.1"
metrics-derive = "0.1.0"
metrics-util = "0.19.0"
mockall = "0.13.0"
parking_lot = "0.12.3"
parse-display = "0.10.0"
Expand Down
2 changes: 1 addition & 1 deletion bin/rundler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ metrics.workspace = true
metrics-derive.workspace = true
metrics-exporter-prometheus = { version = "0.16.2", default-features = false, features = ["http-listener"] }
metrics-process = "2.4.0"
metrics-util = "0.19.0"
metrics-util.workspace = true
opentelemetry = "0.32.0"
opentelemetry-otlp = { version = "0.32.0", features = ["grpc-tonic"] }
opentelemetry_sdk = "0.32.1"
Expand Down
27 changes: 26 additions & 1 deletion bin/rundler/src/cli/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::{net::SocketAddr, time::Duration};
use itertools::Itertools;
use metrics::Gauge;
use metrics_derive::Metrics;
use metrics_exporter_prometheus::PrometheusBuilder;
use metrics_exporter_prometheus::{Matcher, PrometheusBuilder};
use metrics_process::Collector;
use metrics_util::layers::{PrefixLayer, Stack};
use rundler_task::TaskSpawner;
Expand All @@ -39,6 +39,31 @@ pub fn initialize<'a, T: TaskSpawner>(
}

builder = builder.set_buckets(buckets)?;
// ratio histograms need their own buckets, the global ones are sized for milliseconds
for name in rundler_pool::GAS_EFFICIENCY_HISTOGRAMS {
builder = builder.set_buckets_for_metric(
Matcher::Full(format!("rundler.{name}")),
rundler_pool::GAS_EFFICIENCY_BUCKETS,
)?;
}
for name in rundler_builder::BUNDLE_RATIO_HISTOGRAMS {
builder = builder.set_buckets_for_metric(
Matcher::Full(format!("rundler.{name}")),
rundler_builder::BUNDLE_RATIO_BUCKETS,
)?;
}
for name in rundler_builder::BUNDLE_OP_COUNT_HISTOGRAMS {
builder = builder.set_buckets_for_metric(
Matcher::Full(format!("rundler.{name}")),
rundler_builder::BUNDLE_OP_COUNT_BUCKETS,
)?;
}
for name in rundler_sim::ESTIMATION_ETH_CALL_HISTOGRAMS {
builder = builder.set_buckets_for_metric(
Matcher::Full(format!("rundler.{name}")),
rundler_sim::ESTIMATION_ETH_CALL_BUCKETS,
)?;
}

let (recorder, exporter) = builder.build()?;
task_spawner.spawn_critical(
Expand Down
3 changes: 3 additions & 0 deletions crates/builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ alloy-network.workspace = true
alloy-primitives.workspace = true
alloy-signer.workspace = true
alloy-signer-local.workspace = true
alloy-sol-types.workspace = true

anyhow.workspace = true
async-trait.workspace = true
Expand All @@ -28,6 +29,7 @@ metrics-derive.workspace = true
prost.workspace = true
rand.workspace = true
reqwest = { workspace = true, default-features = false, features = ["json"] }
rundler-contracts.workspace = true
rundler-provider.workspace = true
rundler-signer.workspace = true
rundler-sim.workspace = true
Expand All @@ -49,6 +51,7 @@ tracing.workspace = true
alloy-json-rpc.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-transport.workspace = true
metrics-util = { workspace = true, features = ["debugging"] }
mockall.workspace = true
rundler-provider = { workspace = true, features = ["test-utils"] }
rundler-sim = { workspace = true, features = ["test-utils"] }
Expand Down
Loading
Loading