Metric events

A metric event in Vector represents a numerical operation performed on a time series. In Vector, unlike in other tools, metrics are first-class citizens. They are not represented as logs. This makes them interoperable with various metrics services without the need for any transformation.

Vector’s metric data model favors accuracy and correctness over ideological purity. Vector’s metric types are thus an agglomeration of various metric types found in the wild, such as Prometheus and Statsd. This ensures that metrics are correctly interoperable between systems.

Schema

A Vector metric event represents a numerical operation performed on a time series. Unlike other tools, metrics in Vector are first class citizens, they are not represented as structured logs. This makes them interoperable with various metrics services without the need for any transformation.

Vector’s metric data model favors accuracy and correctness over ideological purity. Therefore, Vector’s metric types are a conglomeration of various metric types found in the wild, such as Prometheus and Statsd. This ensures metric data is correctly interoperable between systems.

Options

counter

common optional table
A single value that can be incremented or reset to a zero value but not decremented.

value

required float
The value to increment the counter by. Can only be positive.
Examples 1 10 500

distribution

common optional table
A distribution represents a distribution of sampled values. It is used with services that support global histograms and summaries.

samples

required array
The set of sampled values.

statistic

required string literal enum
The statistic to be calculated from the values.
Examples histogram summary

gauge

common optional table
A gauge represents a point-in-time value that can increase and decrease. Vector’s internal gauge type represents changes to that value. Gauges should be used to track fluctuations in values, like current memory or CPU usage.

value

required float
A specific point-in-time value for the gauge.
Examples 1 10 500

histogram

common optional table
Also called a timer. A histogram samples observations (usually things like request durations or response sizes) and counts them in configurable buckets. It also provides a sum of all observed values.

buckets

required array
The set of buckets containing the histogram values.

count

required uint
The total number of values contained within the histogram.
Examples 1 10 25 100

sum

required float
The sum of all values contained within the histogram.
Examples 1 10 25 100

kind

required string
The metric value kind.

name

required string
The metric name.

namespace

required string
The metric namespace. Depending on the service, this will prepend the name or use native namespacing facilities.

set

common optional table
A set represents an array of unique values.

values

required array
The list of unique values.

summary

common optional table
Similar to a histogram, a summary samples observations (usually things like request durations and response sizes). While it also provides a total count of observations and a sum of all observed values, it calculates configurable quantiles over a sliding time window.

count

required uint
The total number of values contained within the summary.
Examples 54

quantiles

required array
The set of observations.

sum

required float
The sum of all values contained within the histogram.
Examples 1 10 25 100

tags

required table
The metric tags. Key/value pairs, nesting is not allowed.

*

optional *
Key/value pairs, nesting is not allowed.

timestamp

required timestamp
The metric timestamp; when the metric was created.