Package-level declarations

Types

Link copied to clipboard

One stage of work being observed, from its start to its end: a span and its timings, say.

Link copied to clipboard
sealed class ObservedEvent

Something the core noticed that has no duration of its own, told to Observer.observed: a refusal, a dropped signal, a partition paused. An observer counts it, logs it or ignores it; the core goes on either way. The core builds each, so their constructors are internal to Wow; an observer matches on the type (when (event)) and reads the fields. Types may be added, so a when over them keeps an else branch.

Link copied to clipboard

How an observed stage ended (Observation.outcome): its span's wow.outcome and the tag of its metric. A value is lower case and one word per concept, whichever stage reports it: a command committed before is duplicate to its execution, its append and its timer alike.

Link copied to clipboard
interface Observer

The observation seams of the core: where the kernel and the runtime tell an observer, such as wow-observability's tracing and metrics, that a stage of their work starts. The core knows no tracing or metrics library; an observer only watches and never changes what the work does (06-modules §3).

Link copied to clipboard

The trace a coroutine's work belongs to: the element an Observer's observation puts in the coroutine context, opaque to the core. The runtime carries it to the coroutines it starts for the same work (traceContext) and writes its fields where the work goes on elsewhere (trace).

Properties

Link copied to clipboard

The propagation fields of the trace this context's work belongs to; empty when it belongs to none.

Link copied to clipboard

The TraceContext of this context alone, to start another coroutine of the same work in; empty when none.

Functions

Link copied to clipboard
inline suspend fun <T> Observation.observe(crossinline block: suspend () -> T): T

Runs block as this observed stage: in its Observation.context, telling it what block fails with, and ending it once block returns or fails. For Observation.NONE it only runs block.