Generic OTLP distributed-tracing pipeline for Crabka services.
The consuming service always installs a tracing_subscriber fmt layer
(stdout, gated by the usual RUST_LOG EnvFilter). When OTLP export is
configured via the environment, a second tracing-opentelemetry layer is
attached that converts tracing spans into OpenTelemetry spans and
batch-exports them over OTLP to a collector (gRPC :4317 or
HTTP/protobuf :4318).
Enabling
OTLP is off by default — a service with no OTLP environment behaves
byte-for-byte as before. It turns on when any endpoint is set
(CRABKA_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT,
OTEL_EXPORTER_OTLP_ENDPOINT) or CRABKA_OTLP_ENABLED=true, and is
force-disabled by OTEL_SDK_DISABLED=true.
Resolve OTLP settings without touching the environment
use ;
let cfg = from_env.unwrap;
assert_eq!;
assert_eq!;