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: 5 additions & 1 deletion crates/ethereum/cli/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ where
#[cfg(feature = "otlp")]
if let Some(output_type) = &self.cli.traces.otlp {
info!(target: "reth::cli", "Starting OTLP tracing export to {:?}", output_type);
layers.with_span_layer("reth".to_string(), output_type.clone())?;
layers.with_span_layer(
"reth".to_string(),
output_type.clone(),
self.cli.traces.otlp_level,
)?;
}

self.guard = self.cli.logs.init_tracing_with_layers(layers)?;
Expand Down
23 changes: 22 additions & 1 deletion crates/node/core/src/args/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

use clap::Parser;
use eyre::{ensure, WrapErr};
use tracing::Level;
use url::Url;

/// CLI arguments for configuring `Opentelemetry` trace and span export.
#[derive(Debug, Clone, Default, Parser)]
#[derive(Debug, Clone, Parser)]
pub struct TraceArgs {
/// Enable `Opentelemetry` tracing export to an OTLP endpoint.
///
Expand All @@ -23,6 +24,26 @@ pub struct TraceArgs {
help_heading = "Tracing"
)]
pub otlp: Option<Url>,

/// Set the minimum log level for OTLP traces.
///
/// Valid values: ERROR, WARN, INFO, DEBUG, TRACE
///
/// Defaults to TRACE if not specified.
#[arg(
long = "tracing-otlp-level",
global = true,
value_name = "LEVEL",
default_value = "TRACE",
help_heading = "Tracing"
)]
pub otlp_level: Level,
}

impl Default for TraceArgs {
fn default() -> Self {
Self { otlp: None, otlp_level: Level::TRACE }
}
}

// Parses and validates an OTLP endpoint url.
Expand Down
6 changes: 5 additions & 1 deletion crates/optimism/cli/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ where
#[cfg(feature = "otlp")]
if let Some(output_type) = &self.cli.traces.otlp {
info!(target: "reth::cli", "Starting OTLP tracing export to {:?}", output_type);
layers.with_span_layer("reth".to_string(), output_type.clone())?;
layers.with_span_layer(
"reth".to_string(),
output_type.clone(),
self.cli.traces.otlp_level,
)?;
}

self.guard = self.cli.logs.init_tracing_with_layers(layers)?;
Expand Down
5 changes: 3 additions & 2 deletions crates/tracing/src/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::{
fmt,
path::{Path, PathBuf},
};
use tracing::level_filters::LevelFilter;
use tracing_appender::non_blocking::WorkerGuard;
use tracing_subscriber::{filter::Directive, EnvFilter, Layer, Registry};
use url::Url;
Expand Down Expand Up @@ -131,13 +132,13 @@ impl Layers {
&mut self,
service_name: String,
endpoint_exporter: Url,
level: tracing::Level,
) -> eyre::Result<()> {
// Create the span provider

use tracing::{level_filters::LevelFilter, Level};
let span_layer = span_layer(service_name, &endpoint_exporter)
.map_err(|e| eyre::eyre!("Failed to build OTLP span exporter {}", e))?
.with_filter(LevelFilter::from_level(Level::TRACE));
.with_filter(LevelFilter::from_level(level));

self.add_layer(span_layer);

Expand Down
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/checksum.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/clear.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/clear/mdbx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/clear/static-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/diff.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/drop.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/get/mdbx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/get/static-file.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/list.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/path.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/repair-trie.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/stats.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/db/version.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/download.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/dump-genesis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
9 changes: 9 additions & 0 deletions docs/vocs/docs/pages/cli/reth/export-era.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,13 @@ Tracing:
If no value provided, defaults to `http://localhost:4318/v1/traces`.

Example: --tracing-otlp=http://collector:4318/v1/traces

--tracing-otlp-level <LEVEL>
Set the minimum log level for OTLP traces.

Valid values: ERROR, WARN, INFO, DEBUG, TRACE

Defaults to TRACE if not specified.

[default: TRACE]
```
Loading