OpenTelemetryClient
Sink for OpenTelemetrySpans. Bridge this to a real tracer, or to AnalyticsClient.
Inheritors
Functions
Link copied to clipboard
Link copied to clipboard
inline fun <T> OpenTelemetryClient.trace(name: String, kind: String = SpanKind.INTERNAL, attributes: Map<String, Any> = emptyMap(), block: () -> T): T
Times block and records it as a span: SpanStatus.OK on success, SpanStatus.ERROR (with ERROR_TYPE_ATTRIBUTE) when it throws. Cancellation is recorded as SpanStatus.UNSET, since a cancelled operation did not fail. The exception is always rethrown. Sink failures are ignored so recording cannot change the result or replace the original exception. The inline block also supports suspending calls from a coroutine.