From 3ac5bf4dd110a86cef8e6e79e56c720a128565a0 Mon Sep 17 00:00:00 2001 From: YK Date: Fri, 14 Nov 2025 20:55:33 +0800 Subject: [PATCH] feat(bench-compare): add configurable OTLP trace queue size (#19737) Co-authored-by: Alexey Shekhirin <5773434+shekhirin@users.noreply.github.com> --- bin/reth-bench-compare/src/cli.rs | 10 ++++++++++ bin/reth-bench-compare/src/node.rs | 6 +++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bin/reth-bench-compare/src/cli.rs b/bin/reth-bench-compare/src/cli.rs index a494b1aec4..89d3d874cd 100644 --- a/bin/reth-bench-compare/src/cli.rs +++ b/bin/reth-bench-compare/src/cli.rs @@ -134,6 +134,16 @@ pub(crate) struct Args { #[command(flatten)] pub traces: TraceArgs, + /// Maximum queue size for OTLP Batch Span Processor (traces). + /// Higher values prevent trace drops when benchmarking many blocks. + #[arg( + long, + value_name = "OTLP_BUFFER_SIZE", + default_value = "32768", + help_heading = "Tracing" + )] + pub otlp_max_queue_size: usize, + /// Additional arguments to pass to baseline reth node command /// /// Example: `--baseline-args "--debug.tip 0xabc..."` diff --git a/bin/reth-bench-compare/src/node.rs b/bin/reth-bench-compare/src/node.rs index f449642700..c401199daa 100644 --- a/bin/reth-bench-compare/src/node.rs +++ b/bin/reth-bench-compare/src/node.rs @@ -30,6 +30,7 @@ pub(crate) struct NodeManager { additional_reth_args: Vec, comparison_dir: Option, tracing_endpoint: Option, + otlp_max_queue_size: usize, } impl NodeManager { @@ -46,6 +47,7 @@ impl NodeManager { additional_reth_args: args.reth_args.clone(), comparison_dir: None, tracing_endpoint: args.traces.otlp.as_ref().map(|u| u.to_string()), + otlp_max_queue_size: args.otlp_max_queue_size, } } @@ -267,7 +269,9 @@ impl NodeManager { // Set high queue size to prevent trace dropping during benchmarks if self.tracing_endpoint.is_some() { - cmd.env("OTEL_BLRP_MAX_QUEUE_SIZE", "10000"); + cmd.env("OTEL_BSP_MAX_QUEUE_SIZE", self.otlp_max_queue_size.to_string()); // Traces + cmd.env("OTEL_BLRP_MAX_QUEUE_SIZE", "10000"); // Logs + // Set service name to differentiate baseline vs feature runs in Jaeger cmd.env("OTEL_SERVICE_NAME", format!("reth-{}", ref_type)); }