Skip to main content

oxios_kernel/
telemetry_stub.rs

1//! Stub telemetry module (no OTel feature).
2//!
3//! Provides the same public API as the `otel` version but is a no-op.
4
5use anyhow::Result;
6
7/// Telemetry configuration.
8#[derive(Debug, Clone)]
9pub struct TelemetryConfig {
10    /// Enable OpenTelemetry tracing.
11    pub enabled: bool,
12    /// OTLP endpoint (e.g., "http://localhost:4317").
13    pub endpoint: Option<String>,
14    /// Service name for traces.
15    pub service_name: String,
16}
17
18impl Default for TelemetryConfig {
19    fn default() -> Self {
20        Self {
21            enabled: false,
22            endpoint: None,
23            service_name: "oxios".into(),
24        }
25    }
26}
27
28/// Initialize OTel layers — no-op when compiled without the `otel` feature.
29pub fn init_telemetry_layers(
30) -> Result<Vec<Box<dyn tracing_subscriber::Layer<tracing_subscriber::Registry> + Send + Sync>>> {
31    Ok(vec![])
32}