Metrics
Central utility object for metrics collection and tagging in the Wow framework. Provides constants for metric keys, extension functions for reactive streams tagging, and factory methods to wrap components with metric decorators.
This object serves as the main entry point for enabling metrics collection across all Wow components like command buses, event buses, handlers, and repositories.
Properties
Metric tag key for aggregate names
Metric tag key for command names
Metric tag key for processor names
Metric tag key for source component identification
Context key for storing metrics subscriber information in reactive contexts
Metric tag key for subscriber identification
Functions
Retrieves the metrics subscriber identifier from the reactive context.
Automatically wraps supported Wow components with their corresponding metric decorators. This function inspects the type of the component and applies the appropriate metric wrapper if metrics are enabled and the component is not already metrizable.
Wraps a DistributedCommandBus with metrics collection capabilities. Returns a MetricDistributedCommandBus that collects metrics on command operations.
Wraps a LocalCommandBus with metrics collection capabilities. Returns a MetricLocalCommandBus that collects metrics on command operations.
Wraps a DistributedDomainEventBus with metrics collection capabilities. Returns a MetricDistributedDomainEventBus that collects metrics on domain event operations.
Wraps a DomainEventHandler with metrics collection capabilities. Returns a MetricDomainEventHandler that collects metrics on domain event handling operations.
Wraps a LocalDomainEventBus with metrics collection capabilities. Returns a MetricLocalDomainEventBus that collects metrics on domain event operations.
Wraps an EventStore with metrics collection capabilities. Returns a MetricEventStore that collects metrics on event storage operations.
Wraps a SnapshotHandler with metrics collection capabilities. Returns a MetricSnapshotHandler that collects metrics on snapshot handling operations.
Wraps a SnapshotRepository with metrics collection capabilities. Returns a MetricSnapshotRepository that collects metrics on snapshot storage operations.
Wraps a SnapshotStrategy with metrics collection capabilities. Returns a MetricSnapshotStrategy that collects metrics on snapshot strategy operations.
Wraps a DistributedStateEventBus with metrics collection capabilities. Returns a MetricDistributedStateEventBus that collects metrics on state event operations.
Wraps a LocalStateEventBus with metrics collection capabilities. Returns a MetricLocalStateEventBus that collects metrics on state event operations.
Wraps a CommandHandler with metrics collection capabilities. Returns a MetricCommandHandler that collects metrics on command handling operations.
Wraps a ProjectionHandler with metrics collection capabilities. Returns a MetricProjectionHandler that collects metrics on projection handling operations.
Wraps a StatelessSagaHandler with metrics collection capabilities. Returns a MetricStatelessSagaHandler that collects metrics on saga handling operations.
Conditionally applies a metric decorator to a component based on configuration. This function checks if metrics are enabled and if the component is not already metrizable before applying the provided decoration block.
Sets the metrics subscriber identifier in the reactive context.
Tags a Flux stream with subscriber information from the reactive context. If no subscriber is present in the context, applies default metrics without subscriber tagging.
Writes the metrics subscriber identifier to the reactive context of a Flux stream.