measure

suspend fun <T> measure(operation: Operation, attributes: Map<String, String> = emptyMap(), block: suspend () -> T): T

Times block, reports the outcome, and returns its result.

Cancellation is reported as Outcome.CANCELLED and rethrown, never as a failure — a cancelled caller is not a failed operation, and conflating the two is what makes cancellation bugs hard to see. A thrown TelemetrySink error is swallowed: telemetry must not be able to fail an operation that otherwise succeeded.