Metric Event

Description

A metric event represents a numerical operation performed on 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"
},
"counter": {
"value": 24.2
}
}

Schema

The metric data model is comprised of 6 types:

A metric event contains a map named after one of these types at the top level. This map contains corresponding numeric values.

In addition, all kinds of metric events have the following top level fields: name, timestamp, kind, tags.

  • 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
    • uintcommonrequired

      count

      The total number of values contained within the histogram.

      • No default
      • View examples
    • [uint]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
    • No default
  • 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.

    • uintcommonrequired

      count

      The total number of values contained within the summary.

      • No default
      • View examples
    • [double]commonrequired

      quantiles

      The quantiles contained within the summary, 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
    • No default
  • 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
    • No default
  • structoptional

    distribution

    A distribution represents a distribution of sampled values.

    • [uint]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
    • No default
  • 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
    • No default
  • 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
  • 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
    • No default
  • 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

Components

View all metric-compatible components