Skip to content

OpenTelemetry support #31

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

Merged
merged 1 commit into from
Jun 5, 2025
Merged

Conversation

therustmonk
Copy link
Collaborator

@therustmonk therustmonk commented May 13, 2025

Adds OpenTelemetry support. To use it, activate --feature=telemetry. A feature gate is used to avoid integrating all opentelemetry dependencies when they’re not needed.

Key changes: since access to the tracing layer requires CliApp (which is Cli with additional configuration fields), the .configure() method is used after parsing parameters.

CliApp also uses the Launcher trait, allowing different types to configure the launch process. In our case, the launcher is implemented as a struct instead of a closure, and there's an empty Launcher for other (non-node) commands, as reth currently doesn’t allow omitting the launcher even when it’s not needed.

To run, you can try:

cargo run --features telemetry -p op-rbuilder --bin op-rbuilder -- node --dev

docker run --rm --name jaeger \
      --network ethplayground \
      -p 16686:16686 \
      -p 4317:4317 \
      -p 4318:4318 \
      -p 5778:5778 \
      -p 9411:9411 \
      jaegertracing/jaeger:2.6.0

Than open http://localhost:16686/

✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

@therustmonk therustmonk changed the title OpenTelemetry support (experimental) OpenTelemetry support May 29, 2025
@therustmonk therustmonk marked this pull request as ready for review June 5, 2025 11:00
@@ -0,0 +1,149 @@
use super::{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this launcher on main.rs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, moved that to the main.rs 👌

@@ -70,13 +70,17 @@ impl CliExt for Cli {

/// Returns the type of builder implementation that the node is started with.
/// Currently supports `Standard` and `Flashblocks` modes.
fn builder_mode(&self) -> BuilderMode {
fn builder_mode(&self) -> Option<BuilderMode> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we revert this change? We want to default for now to Standard if nothing else is set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, reverted and also squashed commits.

@ferranbt ferranbt merged commit cd9684c into flashbots:main Jun 5, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants