MetricValue

sealed interface MetricValue

The aggregated value of one instrument for one attribute set over one collection interval.

VariantMemory per attribute setPercentilesTemporality
Sum1 numbernodelta
LastValue1 numbernoabsolute
Summary4 numbers (fixed)nodelta
Distributiongrows with distinct valuesyesdelta

Inheritors

Types

Link copied to clipboard
class Distribution(val values: Map<Double, Long>, val truncated: Boolean = false) : MetricValue

Distinct values with their occurrence counts - maps to CloudWatch Values and Counts.

Link copied to clipboard
class LastValue(val value: Double) : MetricValue

An absolute value sampled at collection time, produced only by async instruments.

Link copied to clipboard
class Sum(val value: Double, val monotonic: Boolean) : MetricValue

A delta sum over the collection interval, not a running total, because backends such as CloudWatch already aggregate within each period - a cumulative counter at 100 would publish 100 every minute and sum to 6000 over an idle hour. This differs from OpenTelemetry's default temporality.

Link copied to clipboard
class Summary(val count: Long, val sum: Double, val min: Double, val max: Double) : MetricValue

Count / sum / min / max only - maps to a CloudWatch StatisticSet.