Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

CLI-owned telemetry infrastructure.

Provides TokioMpscSink — an async, non-blocking telemetry sink backed by a tokio::sync::mpsc channel. The CLI binary owns the background worker task so the library crate (auths-telemetry) remains tokio-free.

§Usage (async CLI entry point)

use auths_cli::telemetry::TokioMpscSink;
use auths_telemetry::init_telemetry_with_sink;
use std::sync::Arc;

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let sink = TokioMpscSink::new(256);
    init_telemetry_with_sink(Arc::new(sink.clone()));

    let result = run_command().await;

    sink.flush().await;
    result
}

Structs§

TokioMpscSink
Non-blocking telemetry sink backed by a Tokio MPSC channel.