You are creating a Grafana dashboard and need to display a gauge showing the current CPU usage percentage from a Prometheus data source. Which function is most appropriate?
Trap 1: predict_linear()
This is for forecasting future values, not showing the current one.
Trap 2: sum_over_time()
This aggregates values over a duration, which is not suitable for a current gauge.
Trap 3: rate()
rate() is for calculating per-second growth of counters, not for displaying a single instantaneous gauge value.
- A
predict_linear()
Why it fails: This is for forecasting future values, not showing the current one.
- B
sum_over_time()
Why it fails: This aggregates values over a duration, which is not suitable for a current gauge.
- C
rate()
Why it fails: rate() is for calculating per-second growth of counters, not for displaying a single instantaneous gauge value.
- D
No function (raw query)
Queries like 'node_cpu_seconds_total' provide the instantaneous current value suitable for a gauge.