Skip to content

Commit 255498d

Browse files
committed
feat: add an otlp tracing layer
1 parent 748793e commit 255498d

File tree

4 files changed

+138
-15
lines changed

4 files changed

+138
-15
lines changed

Cargo.lock

Lines changed: 129 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ reth-network-peers = { git = "https://github.com/paradigmxyz/reth", rev = "90896
8282
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth", rev = "9089672839a7275c11a77408d3270f786437ff3f" }
8383
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", rev = "9089672839a7275c11a77408d3270f786437ff3f" }
8484
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", rev = "9089672839a7275c11a77408d3270f786437ff3f" }
85+
reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth", rev = "9089672839a7275c11a77408d3270f786437ff3f" }
8586

8687
# reth optimism
8788
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "9089672839a7275c11a77408d3270f786437ff3f" }

crates/op-rbuilder/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ reth-storage-api.workspace = true
5252
reth-rpc-api.workspace = true
5353
reth-rpc-eth-types.workspace = true
5454
reth-tasks.workspace = true
55+
reth-tracing-otlp = { workspace = true, optional = true }
5556

5657
alloy-primitives.workspace = true
5758
alloy-consensus.workspace = true
@@ -147,6 +148,8 @@ min-trace-logs = ["tracing/release_max_level_trace"]
147148

148149
testing = []
149150

151+
tracing = ["reth-tracing-otlp"]
152+
150153
[[bin]]
151154
name = "op-rbuilder"
152155
path = "src/main.rs"

crates/op-rbuilder/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ fn main() -> Result<()> {
4444

4545
let mut cli_app = cli.configure();
4646

47-
// TODO: Add telemetry here
47+
#[cfg(feature = "tracing")]
48+
{
49+
let otlp = reth_tracing_otlp::layer("op-reth");
50+
cli_app.access_tracing_layers()?.add_layer(otlp);
51+
}
4852

4953
cli_app.init_tracing()?;
5054
match mode {

0 commit comments

Comments
 (0)