Prometheus Aggregation Operators
Prometheus provides several aggregation operators that allow you to perform calculations and aggregations on the collected metrics. Here are some commonly used aggregation operators in Prometheus:
1. sum: Calculates the sum of the selected metric over a given time range.
2. avg: Computes the average value of the selected metric over a specified time period.
3. min: Returns the minimum value of the selected metric within a given time range.
4. max: Returns the maximum value of the selected metric within a given time range.
5. count: Counts the number of times the selected metric has been recorded within a given time frame.
6. quantile: Computes the quantile value of the selected metric over a specified time period. For example, "quantile(0.95)"" will give you the 95th percentile value.
7. rate: Calculates the per-second average rate of increase of the selected metric over a given time window.
8. irate: Similar to "rate", but provides an instant rate of increase at each point in time.
9. delta: Computes the difference between the first and last value of the selected metric within a given time range.
10. stddev: Calculates the standard deviation of the selected metric over a specified time period.
These operators can be used in Prometheus's query language, PromQL, to perform aggregations and calculations on your metrics data. By combining these operators with various functions and modifiers, you can derive meaningful insights and create custom monitoring and alerting rules based on your specific requirements.