Sample

class Sample(val name: String, val labelNames: List<String>, val labelValues: List<String>, val value: Double, val timestamp: Long = getCurrentMillis())

Represents a single measurement of a metric.

A sample includes a metric name, associated label pairs, a value, and optionally a timestamp.

Example:

http_requests_total{method="GET", status="200"} 1243 17195259443250043

Constructors

Link copied to clipboard
constructor(name: String, labelNames: List<String>, labelValues: List<String>, value: Double, timestamp: Long = getCurrentMillis())

Properties

Link copied to clipboard

List of label names.

Link copied to clipboard

List of label values (must match the order and size of labelNames).

Link copied to clipboard

Name of the metric.

Link copied to clipboard

Optional timestamp in milliseconds (defaults to current time).

Link copied to clipboard

Value of the sample.