Package-level declarations

Types

Link copied to clipboard

MeterProvider that aggregates measurements in memory for a PeriodicMetricReader to collect. getOrCreateMeter honours its scope argument and caches one Meter per scope, so instrumentation scope survives to the exporter.

Link copied to clipboard

A TelemetryProvider that aggregates metrics in process and exports them periodically.

Link copied to clipboard
class AggregationConfig(val dimensions: Set<String>, val detailedMetrics: Set<String> = emptySet(), val maxCardinality: Int, val maxDistinctValues: Int = DistributionAggregator.DEFAULT_MAX_DISTINCT_VALUES)

Everything the registry needs to decide aggregation and bound growth.

Link copied to clipboard
class Dimension(val name: String, val value: String)

A dimension name/value pair. Lists handed to an exporter are sorted by name, so attribute sets that differ only in population order produce equal keys instead of splitting the series.

Link copied to clipboard
sealed interface FlushMode

Determines when collection happens. A sealed interface rather than a nullable Duration because the two modes differ in behaviour, not just timing.

Link copied to clipboard
class InstrumentDescriptor(val scope: String, val name: String, val units: String? = null, val description: String? = null)

Identifies the instrument that produced a MetricData.

Link copied to clipboard
class MetricData(val descriptor: InstrumentDescriptor, val timestamp: Instant, val points: List<MetricPoint>)

Everything collected for one instrument in one interval - the unit handed to MetricExporter.

Link copied to clipboard
interface MetricExporter

Receives aggregated metrics and delivers them to a backend. Implementing this one interface is enough for a new backend; aggregation, cardinality guarding, temporality, and scheduling are inherited.

Link copied to clipboard
class MetricPoint(val dimensions: List<Dimension>, val value: MetricValue)

A single time series: one dimension set plus its aggregated value. A counter split by operation name yields one point per operation, each a separately billed backend metric.

Link copied to clipboard
sealed interface MetricReader

Decides when aggregated metrics are collected, and owns the MetricExporter they are handed to. Pairing the two is what makes two destinations on two intervals expressible.

Link copied to clipboard
sealed interface MetricValue

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

Link copied to clipboard

Drives collection cycles and hands the results to a MetricExporter.