rlg-otlp 0.0.11

OpenTelemetry network exporter for rlg. Ships records over OTLP/HTTP (JSON) to any OTel-compatible collector — Honeycomb, Datadog, Tempo, Jaeger, otelcol.
docs.rs failed to build rlg-otlp-0.0.11
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: rlg-otlp-0.0.10

Why

The core rlg crate renders records in LogFormat::OTLP shape but only writes them to local sinks (stdout, file, os_log, journald). To actually ship the records to a collector you need a network transport. rlg-otlp is that transport.

OTLP/HTTP JSON is the v0.0.11 wire format. Protobuf is on the v0.0.12 roadmap.

Install

[dependencies]
rlg       = "0.0.11"
rlg-otlp  = "0.0.11"

Requires Rust 1.88.0 or newer (edition 2024).

Usage

use rlg::log::Log;
use rlg::log_format::LogFormat;
use rlg_otlp::OtlpExporter;

let exporter = OtlpExporter::builder()
    .endpoint("https://api.honeycomb.io/v1/logs")
    .header("x-honeycomb-team", std::env::var("HONEYCOMB_API_KEY").unwrap())
    .timeout_secs(10)
    .build();

let record = Log::error("payment-service down")
    .component("orders")
    .with("trace_id", "abc123")
    .format(LogFormat::OTLP);

exporter.export_one(&record).unwrap();

Endpoint examples

Collector URL
Honeycomb https://api.honeycomb.io/v1/logs (set x-honeycomb-team)
Datadog https://http-intake.logs.datadoghq.com/api/v2/logs (set dd-api-key)
Grafana Tempo https://tempo-prod-04-prod-us-east-0.grafana.net/v1/logs
Jaeger http://jaeger-collector:4318/v1/logs
Otelcol http://localhost:4318/v1/logs

License

Dual-licensed under Apache 2.0 or MIT, at your option.