Overview
Theaggregate transform aggregates metrics passing through a Vector topology. It combines metrics with the same series data (name, namespace, tags) over a configurable time interval and applies aggregation functions.
This transform is essential for:
- Downsampling high-frequency metrics
- Reducing metric cardinality
- Computing statistics (mean, max, min, stdev)
- Cost optimization by reducing data volume
- Pre-aggregation before sending to destinations
- Multiple aggregation modes (sum, count, mean, max, min, stdev, diff)
- Configurable flush intervals
- Automatic handling of incremental vs. absolute metrics
- Task transform for stateful aggregation
Configuration
The interval between flushes, in milliseconds.During this time frame, metrics with the same series data (name, namespace, tags) are aggregated.
Function to use for aggregation.Different modes work with incremental metrics, absolute metrics, or both.Available modes:
auto- Default. Sums incremental metrics and uses latest value for absolute metricssum- Sums incremental metrics, ignores absolutelatest- Returns latest value for absolute metrics, ignores incrementalcount- Counts all metrics (incremental and absolute)diff- Returns difference between latest and previous value for absolute, ignores incrementalmax- Max value of absolute metrics, ignores incrementalmin- Min value of absolute metrics, ignores incrementalmean- Mean value of absolute metrics, ignores incrementalstdev- Standard deviation of absolute metrics, ignores incremental
Inputs
List of upstream component IDs.The aggregate transform only accepts metric events. Log and trace events are ignored.
Outputs
The aggregate transform has a single output that emits aggregated metrics at each flush interval. Each output metric contains:- Original metric series (name, namespace, tags)
- Aggregated value based on the selected mode
- Updated timestamp reflecting the aggregation time
Aggregation Modes
Auto Mode (Default)
The most commonly used mode. Intelligently handles both metric types:- Incremental metrics: Values are summed
- Absolute metrics: Latest value is kept
Sum Mode
Sums values of incremental metrics. Ignores absolute metrics.- Downsampling counters
- Aggregating request counts
- Combining incremental measurements
Latest Mode
Keeps the most recent value for absolute metrics. Ignores incremental metrics.- Gauge metrics
- Current state measurements
- Latest resource utilization
Count Mode
Counts the number of metric samples received, regardless of their values.- Counting samples per time window
- Monitoring metric submission rate
- Data quality checks
Diff Mode
Computes the difference between the latest absolute metric value and the previous flush’s value.- Converting absolute metrics to incremental
- Computing deltas (e.g., disk usage change)
- Rate calculations
Max Mode
Returns the maximum value for absolute gauge metrics.- Peak resource usage
- Maximum response times
- High-water marks
Min Mode
Returns the minimum value for absolute gauge metrics.- Minimum available resources
- Fastest response times
- Low-water marks
Mean Mode
Computes the arithmetic mean of absolute gauge metric values.- Average resource utilization
- Mean response times
- Smoothing noisy metrics
Stdev Mode
Computes the standard deviation of absolute gauge metric values.- Variability analysis
- Detecting inconsistent metrics
- Statistical monitoring
Examples
Basic Metric Aggregation
Sum Request Counters
Compute Average CPU Usage
Track Peak Memory Usage
Count Metric Samples
Convert Absolute to Incremental
Pre-aggregation Pipeline
Multi-mode Aggregation
Metric Series Grouping
Metrics are grouped by their series identity:- Metric name
- Metric namespace
- All tags/labels
- Metric kind (incremental/absolute)
Performance Considerations
Memory Usage
The aggregate transform maintains state for each unique metric series during the flush interval. Memory usage scales with:- Number of unique metric series
- Flush interval duration
- Aggregation mode (mean/stdev use more memory)
Choosing Interval Duration
Shorter intervals (1-10 seconds):- Lower latency
- Higher throughput to downstream
- Less memory usage
- More granular data
- Higher latency
- Lower throughput to downstream
- More memory usage
- More aggressive downsampling
Flush Behavior
Metrics are flushed:- On interval: Every
interval_msmilliseconds - On shutdown: When Vector stops, all buffered metrics are flushed immediately
Metrics and Monitoring
The aggregate transform emits internal metrics:component_received_events_total- Total metrics receivedcomponent_sent_events_total- Total metrics emittedaggregate_events_recorded_total- Metrics recorded into aggregation stateaggregate_flushed_total- Number of flush operationsaggregate_update_failed_total- Failed metric updates (type mismatches)
Common Issues
Conflicting Metric Types
If the same metric series has conflicting types (e.g., first as counter, then as gauge), the new value overwrites the old:Missing Metrics
If metrics appear to be missing:- Check the flush interval - metrics are only emitted at flush time
- Verify metric kind matches the aggregation mode
- Check for series mismatches (different tags)
Unexpected Values
If aggregated values are unexpected:- Verify the aggregation mode is appropriate for metric type
- Check metric kind (incremental vs. absolute)
- Review metric arrival order and timestamps
Use Cases
Cost Reduction
Reduce metric storage and ingestion costs:Alert Pre-aggregation
Pre-aggregate before alerting systems:Backend Protection
Protect downstream systems from metric storms:Multi-resolution Metrics
Create multiple resolutions for different retention periods:See Also
- Reduce Transform - Aggregate log events
- Throttle Transform - Rate limiting
- Metric Sources - Metric ingestion
- Prometheus Sink - Metric destinations