Incremental to Absolute

Convert incremental metrics to absolute

status: beta egress: stream state: stateful
input: metrics
output: metrics
Converts incremental metrics to absolute. Absolute metrics are emitted unchanged to downstream components.

Configuration

Example configurations

{
  "transforms": {
    "my_transform_id": {
      "type": "incremental_to_absolute",
      "inputs": [
        "my-source-or-transform-id"
      ]
    }
  }
}
[transforms.my_transform_id]
type = "incremental_to_absolute"
inputs = [ "my-source-or-transform-id" ]
transforms:
  my_transform_id:
    type: incremental_to_absolute
    inputs:
      - my-source-or-transform-id
{
  "transforms": {
    "my_transform_id": {
      "type": "incremental_to_absolute",
      "inputs": [
        "my-source-or-transform-id"
      ]
    }
  }
}
[transforms.my_transform_id]
type = "incremental_to_absolute"
inputs = [ "my-source-or-transform-id" ]
transforms:
  my_transform_id:
    type: incremental_to_absolute
    inputs:
      - my-source-or-transform-id

cache

optional object

Configuration for the internal metrics cache used to normalize a stream of incremental metrics into absolute metrics.

By default, incremental metrics are evicted after 5 minutes of not being updated. The next incremental value will be reset.

cache.max_bytes

optional uint
The maximum size in bytes of the events in the metrics normalizer cache, excluding cache overhead.

cache.max_events

optional uint
The maximum number of events of the metrics normalizer cache

cache.time_to_live

optional uint
The maximum age of a metric not being updated before it is evicted from the metrics normalizer cache.
default: 300(seconds)

graph

optional object

Extra graph configuration

Configure output for component when generated with graph command

graph.node_attributes

optional object

Node attributes to add to this component’s node in resulting graph

They are added to the node as provided

graph.node_attributes.*
required string literal
A single graph node attribute in graphviz DOT language.
Examples
{
  "color": "red",
  "name": "Example Node",
  "width": "5.0"
}

inputs

required [string]

A list of upstream source or transform IDs.

Wildcards (*) are supported.

See configuration for more info.

Array string literal
Examples
[
  "my-source-or-transform-id",
  "prefix-*"
]

Input Types

The following table lists all telemetry data types supported by the component across possible configurations. Be aware that the available data types may differ based on the specified codec configuration.

Metrics

The following metrics are supported:
counter distribution gauge histogram set summary

Outputs

<component_id>

Default output stream of the component. Use this component’s ID as an input to downstream transforms and sinks.

Output Types

Metrics

The modified input metric event.

Telemetry

Metrics

link

component_discarded_events_total

counter
The number of events dropped by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
intentional
True if the events were discarded intentionally, like a filter transform, or false if due to an error.
pid optional
The process ID of the Vector instance.

component_errors_total

counter
The total number of errors encountered by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
error_type
The type of the error
host optional
The hostname of the system Vector is running on.
pid optional
The process ID of the Vector instance.
stage
The stage within the component at which the error occurred.

component_received_event_bytes_total

counter
The number of event bytes accepted by this component either from tagged origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name optional
The name of the container from which the data originated.
file optional
The file from which the data originated.
host optional
The hostname of the system Vector is running on.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the data originated.
peer_path optional
The pathname from which the data originated.
pid optional
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the data originated.
uri optional
The sanitized URI from which the data originated.

component_received_events_count

histogram

A histogram of the number of events passed in each internal batch in Vector’s internal topology.

Note that this is separate than sink-level batching. It is mostly useful for low level debugging performance issues in Vector due to small internal batches.

component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name optional
The name of the container from which the data originated.
file optional
The file from which the data originated.
host optional
The hostname of the system Vector is running on.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the data originated.
peer_path optional
The pathname from which the data originated.
pid optional
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the data originated.
uri optional
The sanitized URI from which the data originated.

component_received_events_total

counter
The number of events accepted by this component either from tagged origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name optional
The name of the container from which the data originated.
file optional
The file from which the data originated.
host optional
The hostname of the system Vector is running on.
mode optional
The connection mode used by the component.
peer_addr optional
The IP from which the data originated.
peer_path optional
The pathname from which the data originated.
pid optional
The process ID of the Vector instance.
pod_name optional
The name of the pod from which the data originated.
uri optional
The sanitized URI from which the data originated.

component_sent_event_bytes_total

counter
The total number of event bytes emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
output optional
The specific output of the component.
pid optional
The process ID of the Vector instance.

component_sent_events_total

counter
The total number of events emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
output optional
The specific output of the component.
pid optional
The process ID of the Vector instance.

transform_buffer_max_byte_size

gauge
The maximum number of bytes the buffer that feeds into a transform can hold.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
output optional
The specific output of the component.
pid optional
The process ID of the Vector instance.

transform_buffer_max_event_size

gauge
The maximum number of events the buffer that feeds into a transform can hold.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
output optional
The specific output of the component.
pid optional
The process ID of the Vector instance.

transform_buffer_utilization

histogram
The utilization level of the buffer that feeds into a transform.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
output optional
The specific output of the component.
pid optional
The process ID of the Vector instance.

transform_buffer_utilization_level

gauge
The current utilization level of the buffer that feeds into a transform.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
output optional
The specific output of the component.
pid optional
The process ID of the Vector instance.

utilization

gauge
A ratio from 0 to 1 of the load on a component. A value of 0 would indicate a completely idle component that is simply waiting for input. A value of 1 would indicate a that is never idle. This value is updated every 5 seconds.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host optional
The hostname of the system Vector is running on.
pid optional
The process ID of the Vector instance.

Examples

Convert incremental metrics to absolute

Given this event...
[{"metric":{"counter":{"value":1.1},"kind":"incremental","name":"counter.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T07:58:44.223543Z"}},{"metric":{"counter":{"value":1.1},"kind":"incremental","name":"counter.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T07:58:45.223543Z"}},{"metric":{"counter":{"value":1.1},"kind":"incremental","name":"counter.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T07:58:46.223543Z"}},{"metric":{"counter":{"value":1.1},"kind":"incremental","name":"counter.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T08:59:45.223543Z"}}]
...and this configuration...
transforms:
  my_transform_id:
    type: incremental_to_absolute
    inputs:
      - my-source-or-transform-id
    cache:
      time_to_live: 10
[transforms.my_transform_id]
type = "incremental_to_absolute"
inputs = [ "my-source-or-transform-id" ]

  [transforms.my_transform_id.cache]
  time_to_live = 10
{
  "transforms": {
    "my_transform_id": {
      "type": "incremental_to_absolute",
      "inputs": [
        "my-source-or-transform-id"
      ],
      "cache": {
        "time_to_live": 10
      }
    }
  }
}
...this Vector event is produced:
[{"metric":{"counter":{"value":1.1},"kind":"absolute","name":"counter.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T07:58:44.223543Z"}},{"metric":{"counter":{"value":2.2},"kind":"absolute","name":"counter.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T07:58:45.223543Z"}},{"metric":{"counter":{"value":3.3},"kind":"absolute","name":"counter.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T07:58:46.223543Z"}},{"metric":{"counter":{"value":1.1},"kind":"absolute","name":"counter.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T08:59:45.223543Z"}}]

How it works

Advantages of Use

Converting incremental metrics to absolute metrics has two major benefits. First, incremental metrics require the entire history to determine the current state, as they depend on previous values to calculate changes. Each absolute metric represents a complete state, making it easier to view historical data accurately for components like the File sink, where some files might end up missing or out of order. Second, it can reduce overhead for downstream components like Prometheus Remote Write, which internally converts incremental to absolute metrics. Converting to absolute metric with this transform prevents the creation of duplicate caches when sending to multiple Prometheus Remote Write sinks.

The conversion is performed based on the order in which incremental metrics are received, not their timestamps. Moreover, absolute metrics received by this transform are emitted unchanged.

State

This component is stateful, meaning its behavior changes based on previous inputs (events). State is not preserved across restarts, therefore state-dependent behavior will reset between restarts and depend on the inputs (events) received since the most recent restart.