Module future

Module future 

Available on crate feature telemetry only.
Expand description

Future instrumentation utilities for tracing async operations.

This module provides utilities for instrumenting Rust futures with telemetry spans. When a future is instrumented, the associated span is automatically entered every time the future is polled.

§Examples

use veecle_telemetry::future::FutureExt;
use veecle_telemetry::span;

async fn example() {
    let span = span!("async_operation", user_id = 123);

    some_async_work().with_span(span).await;
}

async fn some_async_work() {
    // This work will be traced under the "async_operation" span
}

Structs§

WithSpan
A future that has been instrumented with a telemetry span.

Traits§

FutureExt
Extension trait for instrumenting futures with telemetry spans.