How to send traces from rust + tracing_opentelemetry to Honeycomb?

54 views Asked by At

I've set up a basic subscriber for Rust tracing with OpenTelemetry as follows:

let rust_log = dotenv::var("RUST_LOG").unwrap();
if rust_log == "OTEL" {
    // Use OpenTelemetry subscriber
    let tracer = stdout::new_pipeline().install_simple();
    let telemetry = tracing_opentelemetry::layer().with_tracer(tracer);
    let otel_subscriber = tracing_subscriber::Registry::default().with(telemetry);
    tracing::subscriber::set_global_default(otel_subscriber).unwrap();
} else {
    // Revert to what is specified in `RUST_LOG`
    tracing_subscriber::fmt::init();
}

I would now like to change this subscriber to send batched data to Honeycomb. The problem is the official Honeycomb documentation (https://docs.honeycomb.io/getting-data-in/opentelemetry-overview/#using-the-honeycomb-opentelemetry-endpoint) suggests using opentelemetry-otlp, which in turn requires running and maintaining a separate "collector service" (https://crates.io/crates/opentelemetry-otlp).

I would like to do this without running a separate collector service. My understanding is that I should be able to directly send logs to Honeycomb without running an intermediary service to do so. Is this viable?

0

There are 0 answers