Metric Event

Description

A metric event represents a numerical operation to a time series. Operations offered are heavily inspired by the StatsD and Prometheus models, and determine the schema of the metric structure within Vector.

When a metric event is sent to a sink the schema will be translated into the closest equivalent format of the sink protocol.

Examples

Counter
{
"name": "login.count",
"timestamp": "2019-11-01T21:15:47+00:00",
"kind": "absolute",
"tags": {
"host": "my.host.com"
},
"value": {
"type": "counter",
"value": 24.2
}
}

Schema

The metric data model is comprised of 6 types: aggregated_histogram, aggregated_summary, counter, distribution, gauge, set. You'll notice that certain fields are shared across all types.

5 items
stringenumcommonrequired

kind

The metric value kind. This determines how the value is merged downstream if metrics are aggregated.

No default
Enum, must be one of: "absolute" "incremental"
View examples
stringcommonrequired

name

The metric name.

No default
View examples
mapcommonrequired

tags

Tags that add additional metadata or context to the metric. These are simple key/value pairs in string format and cannot be nested.

No default
View examples
timestampcommonrequired

timestamp

The metric timestamp, representing when the metric was created/ingested within Vector.

No default
View examples
structcommonrequired

type

A metric must be one of 6 types.

structoptional

aggregated_histogram

Also called a "timer". A aggregated_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.

[double]commonrequired
buckets

The buckets contained within this histogram.

No default
View examples
intcommonrequired
count

The total number of values contained within the histogram.

No default
View examples
[int]commonrequired
counts

The number of values contained within each bucket.

No default
View examples
doublecommonrequired
sum

The sum of all values contained within the histogram.

No default
View examples
structoptional

aggregated_summary

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.

intcommonrequired
count

The total number of values contained within the summary.

No default
View examples
[double]commonrequired
quantiles

The quantiles contained within the summary, where where 0 ≤ quantile ≤ 1.

No default
View examples
doublecommonrequired
sum

The sum of all values contained within the summary.

No default
View examples
[double]commonrequired
values

The values contained within the summary that align with the quantiles.

No default
View examples
structoptional

counter

A single value that can only be incremented or reset to zero value, it cannot be decremented.

doublecommonrequired
value

The value to increment the counter by. Can only be positive.

No default
View examples
structoptional

distribution

A distribution represents a distribution of sampled values.

[int]commonrequired
sample_rates

The rate at which each individual value was sampled.

No default
View examples
[double]commonrequired
values

The list of values contained within the distribution.

No default
View examples
structoptional

gauge

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.

doublecommonrequired
value

A specific point-in-time value for the gauge.

No default
View examples
structoptional

set

A set represents a count of unique values, AKA the cardinality.

[string]commonrequired
values

The list of unique values.

No default
View examples

Components

View all metric compatible components