Skip to main content

traced

Attribute Macro traced 

Source
#[traced]
Expand description

Marks a function to be automatically traced with OpenTelemetry

Automatically creates spans with proper context propagation.

§Example

#[traced]
async fn fetch_user(user_id: String) -> Result<User, Error> {
    // Span created automatically with name "fetch_user"
    // Span includes function arguments as attributes
    Ok(user)
}