Skip to content

Add the telemetry feature to the op-rbuilder #603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
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
139 changes: 123 additions & 16 deletions Cargo.lock

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

17 changes: 16 additions & 1 deletion crates/op-rbuilder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,21 @@ tokio-tungstenite = "0.26.2"
rand = "0.9.0"
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] }

# OpenTelemetry dependencies
opentelemetry = { version = "0.29.1", optional = true }
opentelemetry_sdk = { version = "0.29", optional = true }
opentelemetry-otlp = { version = "0.29.0", optional = true, features = ["grpc-tonic"] }
opentelemetry-semantic-conventions = { version = "0.29.0", optional = true }
tracing-opentelemetry = { version = "0.30.0", optional = true }

# `flashblocks` branch
rollup-boost = { git = "http://github.com/flashbots/rollup-boost", rev = "60885346d4cf7f241de82790478195747433d472" }

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { version = "0.6", optional = true }

[features]
default = ["jemalloc"]
default = ["jemalloc", "telemetry"]

jemalloc = [
"dep:tikv-jemallocator",
Expand All @@ -118,6 +125,14 @@ min-trace-logs = ["tracing/release_max_level_trace"]
integration = []
flashblocks = []

telemetry = [
"opentelemetry",
"opentelemetry_sdk",
"opentelemetry-otlp",
"opentelemetry-semantic-conventions",
"tracing-opentelemetry",
]

[[bin]]
name = "op-rbuilder"
path = "src/main.rs"
Expand Down
12 changes: 12 additions & 0 deletions crates/op-rbuilder/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,16 @@ pub struct OpRbuilderArgs {
/// Signals whether to log pool transaction events
#[arg(long = "builder.log-pool-transactions", default_value = "false")]
pub log_pool_transactions: bool,
/// OpenTelemetry endpoint for metrics
#[cfg(feature = "telemetry")]
#[arg(long, value_name = "TRACING")]
pub tracing: bool,
/// OpenTelemetry endpoint for metrics
#[cfg(feature = "telemetry")]
#[arg(
long,
value_name = "TRACING_ENDPOINT",
default_value = "http://localhost:4317"
)]
pub tracing_endpoint: String,
}
Loading