klieo-otel 3.4.0

OpenTelemetry tracing exporter for klieo agent runtimes.
Documentation
//! Errors raised by the otel-exporter wiring.

use thiserror::Error;

/// Failure modes for [`crate::install`].
#[non_exhaustive]
#[derive(Debug, Error)]
pub enum OtelError {
    /// The OTLP exporter or tracer provider could not be constructed.
    /// The string carries the underlying error message; the original
    /// exporter-builder error type is suppressed to keep the public
    /// API stable across OTel SDK minor versions.
    #[error("failed to build OTLP exporter: {0}")]
    Build(String),

    /// A global `tracing` subscriber was already installed before
    /// [`crate::install`] ran. Call this crate first, or skip the
    /// other subscriber installer.
    #[error("a global tracing subscriber is already installed: {0}")]
    AlreadyInitialized(String),

    /// The resolved OTLP endpoint is plaintext `http://` to a
    /// non-loopback collector. Spans carry `gen_ai.prompt` /
    /// `gen_ai.completion` attributes — i.e. PII / customer prompts —
    /// so cleartext export to a remote collector is a data-exfiltration
    /// risk. Use `https://`, terminate TLS at a sidecar, or point at a
    /// loopback collector. W8 / W2.A12 / CWE-319.
    #[error(
        "OTLP endpoint `{0}` is plaintext http:// to a non-loopback host; \
         use https:// or a loopback collector"
    )]
    PlaintextRemote(String),
}