- Counters: Analyze data whose values are designed to monotonically increase, with any decreases treated as resets (for example, request counts, bytes sent)
- Gauges: Analyze data that can both increase and decrease (for example, temperature, memory usage, queue depth)
Two-step aggregation
This group of functions uses the two-step aggregation pattern. Rather than calculating the final result in one step, you first create an intermediate aggregate by using the aggregate function. Then, use any of the accessors on the intermediate aggregate to calculate a final result. You can also roll up multiple intermediate aggregates with the rollup functions. The two-step aggregation pattern has several advantages:- More efficient because multiple accessors can reuse the same aggregate
- Easier to reason about performance, because aggregation is separate from final computation
- Easier to understand when calculations can be rolled up into larger intervals, especially in window functions and continuous aggregates
- Perform retrospective analysis even when underlying data is dropped, because the intermediate aggregate stores extra information not available in the final result
Samples
Calculate counter delta and rate
Create daily counter aggregates and calculate the change over each day:Calculate gauge statistics
Analyze gauge metrics to understand trends and variability:Roll up and extrapolate counter values
Roll up hourly counter aggregates into daily summaries and extrapolate rates:Available functions
Counter aggregation
counter_agg(): analyze monotonically increasing counter metrics
Gauge aggregation
gauge_agg(): analyze gauge metrics that can increase or decrease