OtelObserver

class OtelObserver(openTelemetry: OpenTelemetry, meters: MeterRegistry, clock: () -> Long = System::currentTimeMillis, messagingSystem: String = MEMORY_SYSTEM) : Observer

The core's Observer on OpenTelemetry and Micrometer: a span for each stage the core observes, in the trace its work belongs to, and the stage's metrics in meters.

StageSpanKindMetric
admissionadmit <context>.<aggregate>INTERNAL
executionexecute <context>.<aggregate>INTERNALWowMetrics.COMMAND_DURATION
decisiondecide <context>.<aggregate>INTERNAL
appendappend <context>.<aggregate>INTERNAL
handling, of the loghandle <subscription>INTERNALWowMetrics.SUBSCRIPTION_LAG
handling, of a topicprocess <topic>CONSUMERWowMetrics.SUBSCRIPTION_LAG
timer firingfire <command type>INTERNALWowMetrics.TIMER_DELAY

A subscription's partition paused on a systemic failure, and resumed, counts in WowMetrics.PAUSED_NOTICES; NodeMetrics samples WowMetrics.PAUSED_PARTITIONS. One throttled on backpressure, and back at full speed, counts in WowMetrics.THROTTLED_NOTICES, each backpressured attempt in WowMetrics.BACKPRESSURE_REFUSALS; NodeMetrics samples WowMetrics.THROTTLED_PARTITIONS.

A stage that starts from what arrived (a request's trace, an entry's or a message's me.ahoo.wow.spi.log.Transport.trace) is the child of the span those propagation fields name, as openTelemetry's propagators extract them; any other is the child of the current span; the admission's parent is the current span when there is one, the request's server span. Every span ends with its wow.outcome, and error.type after a failure (OtelObservation). clock is the wall clock the lag and the timer delay are measured by; messagingSystem is the topic transport's type, a consumer span's messaging.system.

Constructors

Link copied to clipboard
constructor(openTelemetry: OpenTelemetry, meters: MeterRegistry, clock: () -> Long = System::currentTimeMillis, messagingSystem: String = MEMORY_SYSTEM)

Types

Link copied to clipboard

Functions

Link copied to clipboard
open override fun admitting(context: String, aggregate: String, command: String, trace: Map<String, String>): Observation

The admission span is INTERNAL: the request's own server span, a web framework's, is its parent when there is one; the propagation fields the request arrived with are its parent only without it.

Link copied to clipboard
open override fun appending(stream: EventStreamRecord): Observation
Link copied to clipboard
open override fun deciding(command: Command<*>): Observation
Link copied to clipboard
open override fun executing(command: Command<*>, commandType: String): Observation

The execution span carries commandType, the kernel's resolved name (context.aggregate.Name, @Name included), as the admission span carries the request's command under its type: one value for wow.command.name on both.

Link copied to clipboard
open override fun firing(timer: Timer): Observation
Link copied to clipboard
open override fun handling(group: String, subscription: String, context: String, stream: EventStreamRecord, trace: Map<String, String>, topic: String?): Observation
Link copied to clipboard
open override fun observed(event: ObservedEvent)
Link copied to clipboard
open override fun resuming(trace: Map<String, String>): CoroutineContext