Telemetry
Library-level telemetry: what the SDK did, how it ended, and how long it took.
Instrumentation used to stop at the HTTP boundary. A host running the embedded servers got spans, metrics and a request id, but the work underneath — resolving a DID, signing with a KMS, reading a wallet, verifying a credential — emitted nothing, so a failed verification could not be joined to a cause. This is the missing half.
It deliberately depends on nothing but the Kotlin standard library. The core modules must not acquire an OpenTelemetry or Ktor dependency because a host wants tracing; :observability bridges these events onto whatever the host actually runs.
Installing
Telemetry.install(sink) // process-wide, typically once at startupNothing is recorded until a host installs a sink, and the default sink costs one volatile read per operation.
Correlating
A correlation id travels in the coroutine context, so a library event can be joined to the request that caused it without threading a parameter through every public signature:
withContext(TelemetryContext(requestId)) { credentialService.verify(credential) }Functions
Replaces the process-wide sink. Returns the previous one so a host can restore it.
True when a host has installed something; lets hot paths skip building attributes.
Reports an operation that completed normally but did not succeed — a verification that returned invalid, a resolution that returned a failure result. These never throw, so measure alone would record them as successes.
The installed sink. Callers normally use measure rather than this.
Restores the no-op sink.