MetricPoint

sealed interface MetricPoint

A single metric data point, rendered from a WarpMetricExporter CRDT (via MetricCatalog) into the shape OTLP puts on the wire. The bridge produces these; an OtlpEdge serializes them — the edge never reaches into the CRDTs directly.

valueHash is over the OTLP value fields only (not the observation time), so a re-render of an unchanged series produces the same hash and is skipped by MetricDigest — while a value that advanced re-sends exactly once.

The five variants mirror the five kinds a MetricCatalog holds: a long cumulative sum (Sum), a double-precision cumulative sum (DoubleSum), a last-writer-wins gauge (Gauge), a distinct-count estimate (Cardinality), and a quantile sketch (ExponentialHistogram).

Inheritors

Types

Link copied to clipboard
data class Cardinality(val key: MetricKey, val estimate: Long, val timeEpochNanos: Long) : MetricPoint

A distinct-count estimate rendered as a Gauge-shaped OTLP point.

Link copied to clipboard
data class DoubleSum(val key: MetricKey, val value: Double, val startEpochNanos: Long, val timeEpochNanos: Long) : MetricPoint

A double-precision cumulative monotonic total (OTLP Sum with asDouble).

Link copied to clipboard
data class ExponentialHistogram(val key: MetricKey, val scale: Int, val count: Long, val zeroCount: Long, val zeroThreshold: Double, val positiveOffset: Int, val positiveBucketCounts: List<Long>, val negativeOffset: Int, val negativeBucketCounts: List<Long>, val startEpochNanos: Long, val timeEpochNanos: Long) : MetricPoint

A quantile sketch rendered as an OTLP ExponentialHistogramDataPoint (cumulative temporality — the backing us.tractat.kuilt.crdt.DDSketch is grow-only).

Link copied to clipboard
data class Gauge(val key: MetricKey, val value: Double, val timeEpochNanos: Long) : MetricPoint

A last-writer-wins snapshot (OTLP Gauge).

Link copied to clipboard
data class Sum(val key: MetricKey, val value: Long, val startEpochNanos: Long, val timeEpochNanos: Long) : MetricPoint

A long cumulative monotonic total (OTLP Sum, cumulative temporality).

Properties

Link copied to clipboard
abstract val key: MetricKey

The series this point belongs to.

Functions

Link copied to clipboard
abstract fun valueHash(): Long

A stable hash of the OTLP value fields, used for by-digest dedup.