LibraryTelemetry

class LibraryTelemetry @JvmOverloads constructor(openTelemetry: OpenTelemetry = OpenTelemetry.noop(), emitSpans: Boolean = true) : TelemetrySink

Bridges library events onto the host's OpenTelemetry and Prometheus surfaces.

org.trustweave.core.telemetry.Telemetry is deliberately dependency-free so the core modules do not acquire OpenTelemetry; this is the adapter that gives those events somewhere to go. Install it once, alongside HostObservability:

val library = LibraryTelemetry(openTelemetry)
Telemetry.install(library)
// library.prometheus() is appended to the host scrape by HostObservability

Each event becomes a short span carrying the correlation id the host put in the coroutine context, so a library operation joins the request that caused it, plus counters and a duration histogram per operation. Attributes arrive already bounded and secret-free from the library side; nothing here adds an identifier of its own.

Constructors

Link copied to clipboard
constructor(openTelemetry: OpenTelemetry = OpenTelemetry.noop(), emitSpans: Boolean = true)

Functions

Link copied to clipboard

Prometheus exposition for the library surface; append to the host scrape.

Link copied to clipboard
open override fun record(event: TelemetryEvent)