Aggregate
Aggregate metrics passing through a topology
status: stable
egress: stream
state: stateful
Aggregates multiple metric events into a single metric event based
on a defined interval window. This helps to reduce metric volume at
the cost of granularity.
Configuration
Example configurations
{
"transforms": {
"my_transform_id": {
"type": "aggregate",
"inputs": [
"my-source-or-transform-id"
]
}
}
}
[transforms.my_transform_id]
type = "aggregate"
inputs = [ "my-source-or-transform-id" ]
transforms:
my_transform_id:
type: aggregate
inputs:
- my-source-or-transform-id
{
"transforms": {
"my_transform_id": {
"type": "aggregate",
"inputs": [
"my-source-or-transform-id"
],
"interval_ms": 10000
}
}
}
[transforms.my_transform_id]
type = "aggregate"
inputs = [ "my-source-or-transform-id" ]
interval_ms = 10_000
transforms:
my_transform_id:
type: aggregate
inputs:
- my-source-or-transform-id
interval_ms: 10000
inputs
required [string]A list of upstream source or transform IDs.
Wildcards (*
) are supported.
See configuration for more info.
interval_ms
optional uintThe interval between flushes, in milliseconds.
During this time frame, metrics (beta) with the same series data (name, namespace, tags, and so on) are aggregated.
default:
10000
Outputs
<component_id>
Default output stream of the component. Use this component’s ID as an input to downstream transforms and sinks.
Telemetry
Metrics
linkaggregate_events_recorded_total
counterThe number of events recorded by the aggregate 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.
pid
optional
The process ID of the Vector instance.
aggregate_failed_updates
counterThe number of failed metric updates,
incremental
adds, encountered by the aggregate 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.
pid
optional
The process ID of the Vector instance.
aggregate_flushes_total
counterThe number of flushes done by the aggregate 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.
pid
optional
The process ID of the Vector instance.
component_discarded_events_total
counterThe 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
counterThe 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
counterThe 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
histogramA 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
counterThe 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
counterThe 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
counterThe 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.
utilization
gaugeA 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
Aggregate over 5 seconds
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":2.2},"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":"different.host.com"},"timestamp":"2021-07-12T07:58:45.223543Z"}},{"metric":{"counter":{"value":22.33},"kind":"absolute","name":"gauge.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T07:58:47.223543Z"}},{"metric":{"counter":{"value":44.55},"kind":"absolute","name":"gauge.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T07:58:45.223543Z"}}]
transforms:
my_transform_id:
type: aggregate
inputs:
- my-source-or-transform-id
interval_ms: 5000
[transforms.my_transform_id]
type = "aggregate"
inputs = [ "my-source-or-transform-id" ]
interval_ms = 5_000
{
"transforms": {
"my_transform_id": {
"type": "aggregate",
"inputs": [
"my-source-or-transform-id"
],
"interval_ms": 5000
}
}
}
[{"metric":{"counter":{"value":3.3},"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":"different.host.com"},"timestamp":"2021-07-12T07:58:45.223543Z"}},{"metric":{"counter":{"value":44.55},"kind":"absolute","name":"gauge.1","tags":{"host":"my.host.com"},"timestamp":"2021-07-12T07:58:45.223543Z"}}]
How it works
Advantages of Use
The major advantage to aggregation is the reduction of volume. It may reduce costs
directly in situations that charge by metric event volume, or indirectly by requiring less CPU to
process and/or less network bandwidth to transmit and receive. In systems that are constrained by
the processing required to ingest metric events it may help to reduce the processing overhead. This
may apply to transforms and sinks downstream of the aggregate transform as well.
Aggregation Behavior
Metrics are aggregated based on their kind. During an interval,
incremental
metrics
are “added” and newer absolute
metrics replace older ones in the same series. This results in a reduction
of volume and less granularity, while maintaining numerical correctness. As an example, two
incremental
counter
metrics with values 10 and 13 processed by the transform during a period would be
aggregated into a single incremental
counter
with a value of 23. Two absolute
gauge
metrics with
values 93 and 95 would result in a single absolute
gauge
with the value of 95. More complex
types like distribution
, histogram
, set
, and summary
behave similarly with incremental
values being combined in a manner that makes sense based on their type.