traced

inline fun <T> traced(name: String, block: (TelemetrySpan) -> T): T

Runs block inside a span named name, stopping the span even if block throws.

A throwing block marks the span outcome=error and reports the throwable through Telemetry.recordException before rethrowing it.