Skip to main content

span

Function span 

Source
pub fn span(name: &str) -> Span
Expand description

Start a new SpanKind::Internal child span nested under the currently active span (or a fresh trace if none is active). Use for internal work like a database query or cache lookup.

use rust_web_server::otel;

let span = otel::span("db.query");
span.set_attribute("db.statement", "SELECT 1");