1

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?

Peteris
  • 3,548
  • 4
  • 28
  • 44
  • Does this answer your question? [Rust OpenTelemetry OTLP w/ Honeycomb](/q/74281657/2189130) – kmdreko Jan 03 '23 at 15:59
  • Thanks @kmdreko, this other question also introduces a separate connector service so unfortunately it doesn't answer the question. – Peteris Jan 03 '23 at 16:26
  • 1
    Really? I was under the impression that the accepted answer doesn't require a collector service. – kmdreko Jan 03 '23 at 16:32
  • You're right! Unfortunately I wasn't able to get that version working either, but will keep trying on all fronts. Feel free to submit your comment as an answer and I'll accept it though. – Peteris Jan 04 '23 at 09:40
  • Got another implementation to work: https://github.com/Dhghomon/rust_opentelemetry_honeycomb. – Peteris Jan 04 '23 at 09:56

0 Answers0