Reviewer · Observability
Accurate dashboard metrics
When authoring dashboard panels and PromQL queries, ensure the data shown is both correct and clearly explained: 1. Deduplicate before aggregating/joining. When combining series from multiple sources (e.g. multiple operator replicas, renamed metrics, or differently-labeled exporters), wrap each side of a join or sum with `max by (...)` on the relevant...
When authoring dashboard panels and PromQL queries, ensure the data shown is both correct and clearly explained:
- Deduplicate before aggregating/joining. When combining series from multiple sources (e.g. multiple operator replicas, renamed metrics, or differently-labeled exporters), wrap each side of a join or sum with
max by (...)on the relevant labels first. Otherwise duplicate series get added together and silently inflate the result. For example:sum by (scaledObject, metric) ( max by (cluster, namespace, scaledObject, metric) (rate(keda_scaler_detail_errors_total{...}[$__rate_interval])) + on (cluster, namespace, scaledObject, metric) group_left max by (cluster, namespace, scaledObject, metric) (...) ) -
Show enough of the distribution. For latency/duration panels, prefer showing multiple percentiles (e.g. p50, p90, p99) rather than a single percentile, so viewers can judge the shape of the distribution instead of just a worst-case number.
- Document caveats in the panel description. If a metric doesn’t capture certain behavior (e.g. retries performed internally by a storage client, which inflate latency but don’t show up as separate retry events), say so explicitly in the panel title/description so the data isn’t misread. Favor accurate, slightly verbose descriptions over titles/metrics that could mislead an on-call engineer.
Apply these checks whenever adding or modifying dashboard panels: verify the query can’t double-count series, pick a percentile set that conveys the real distribution, and write descriptions that state exactly what is and isn’t measured.</description> </invoke>