Describe the feature
Right now the otlp exporter only supports http, not grpc:
|
SpanExporter::builder().with_http().with_endpoint(endpoint.to_string()).build()?; |
We should make this support grpc as well, if the user specifies a grpc endpoint in the args:
|
/// CLI arguments for configuring `Opentelemetry` trace and span export. |
|
#[derive(Debug, Clone, Default, Parser)] |
|
pub struct TraceArgs { |
|
/// Enable `Opentelemetry` tracing export to an OTLP endpoint. |
|
/// |
|
/// If no value provided, defaults to `http://localhost:4318/v1/traces`. |
|
/// |
|
/// Example: --tracing-otlp=http://collector:4318/v1/traces |
|
#[arg( |
|
long = "tracing-otlp", |
|
global = true, |
|
value_name = "URL", |
|
num_args = 0..=1, |
|
default_missing_value = "http://localhost:4318/v1/traces", |
|
require_equals = true, |
|
value_parser = parse_otlp_endpoint, |
|
help_heading = "Tracing" |
|
)] |
|
pub otlp: Option<Url>, |
|
} |
|
|
|
// Parses and validates an OTLP endpoint url. |
|
fn parse_otlp_endpoint(arg: &str) -> eyre::Result<Url> { |
|
let url = Url::parse(arg).wrap_err("Invalid URL for OTLP trace output")?; |
|
|
|
// OTLP url must end with `/v1/traces` per the OTLP specification. |
|
ensure!( |
|
url.path().ends_with("/v1/traces"), |
|
"OTLP trace endpoint must end with /v1/traces, got path: {}", |
|
url.path() |
|
); |
|
|
|
Ok(url) |
|
} |
Additional context
No response
Describe the feature
Right now the otlp exporter only supports http, not grpc:
reth/crates/tracing-otlp/src/lib.rs
Line 39 in 59ace58
We should make this support grpc as well, if the user specifies a grpc endpoint in the args:
reth/crates/node/core/src/args/trace.rs
Lines 7 to 40 in 59ace58
Additional context
No response