MetricsSnapshot

@Serializable
data class MetricsSnapshot(val meta: Meta, val intents: IntentMetrics, val actions: ActionMetrics, val state: StateMetrics, val subscriptions: SubscriptionMetrics, val lifecycle: LifecycleMetrics, val exceptions: ExceptionMetrics, val storeConfiguration: StoreConfiguration<MVIState>? = null)

Root metrics payload composed of typed sections. Serializable for transport; the in-memory store configuration is kept separately and not encoded.

Constructors

Link copied to clipboard
constructor(meta: Meta, intents: IntentMetrics, actions: ActionMetrics, state: StateMetrics, subscriptions: SubscriptionMetrics, lifecycle: LifecycleMetrics, exceptions: ExceptionMetrics, storeConfiguration: StoreConfiguration<MVIState>? = null)

Properties

Link copied to clipboard

Metrics for action emission and delivery.

Link copied to clipboard

Exception and recovery metrics.

Link copied to clipboard

Metrics for intent handling.

Link copied to clipboard

Lifecycle metrics for the store.

Link copied to clipboard
val meta: Meta

General metadata for this snapshot.

Link copied to clipboard

Metrics for state transitions.

Link copied to clipboard

In-memory store configuration reference, not serialized.

Link copied to clipboard

Metrics for subscriptions.

Functions

Link copied to clipboard

Returns a snapshot adjusted for the target schema version.

Link copied to clipboard
fun MetricsSnapshot.toOtlpPayload(namespace: String = DEFAULT_NAMESPACE, resourceAttributes: Map<String, String> = emptyMap(), resourceAttributesProvider: (Meta) -> Map<String, String> = { resourceAttributes }, scopeName: String = DEFAULT_SCOPE, temporality: AggregationTemporality = AggregationTemporality.AGGREGATION_TEMPORALITY_CUMULATIVE, fixedTimestamp: Instant? = null, surfaceVersion: MetricsSchemaVersion? = null): OtlpMetricsPayload

Maps a MetricsSnapshot to an OTLP JSON payload ready for serialization.