- Deploy the starter dashboard ConfigMap so Grafana has a base dashboard to edit
- Configure traffic to produce realistic load
- Build state timeline panels that bucket CPU and memory usage into low/medium/high states per pod
- Interpret state timeline patterns to surface operational insights
- A running Kubernetes cluster with Prometheus metrics and Grafana configured
- The starter dashboard YAML available at
~/monitoring/starter-dashboard.yaml

- SREs investigating crash loops or pod restarts during traffic spikes will benefit from pod-level restart count and resource saturation timelines.
- Executives or product managers reviewing long-term trends typically need higher-level metrics (cost, overall capacity); saturation panels are most valuable only when drill-down to pod-level behavior matters.
- low: under 30% (ok)
- medium: 30–60% (warning)
- high: 60%+ (critical)
- Compute per-pod CPU usage rate
- Divide by per-pod CPU limits
- Multiply by 100 to convert to percent
- Group by
podso each pod is a separate timeline row
If some pods do not define CPU or memory limits, the This preserves the percentage intent while preventing division errors.
kube_pod_container_resource_limits denominator can be zero, yielding NaN or no data for that pod. To avoid division-by-zero, wrap the denominator with clamp_min(..., 1e-9):- Edit the dashboard and add a new panel (or duplicate an existing saturation panel).
- Change the visualization type to “State timeline”.
- Switch the query editor to PromQL and paste the PromQL above.
- Set the unit to “percent (0-100)” and configure thresholds (example: 50, 80).
- Save the panel (Dashboard → Save or Dashboard → Settings → JSON Model → Save changes).
pod=~"order-backend-.*":

- Create a new panel or duplicate the frontend CPU state timeline.
- Replace the query with the memory PromQL above.
- Set visualization to “State timeline”, unit to “percent (0-100)”, and thresholds (example: 60, 85).
- Save the panel.
pod=~"order-backend-.*":

- 09:00–12:00 — all pods green (below threshold)
- 12:00–13:00 — all pods yellow (moderate pressure)
- 13:00–14:00 — one pod red, others yellow (one pod overloaded)
- 14:00 onward — all pods return to green
Best practices and tips
- Use thresholds that align with your operational playbooks and SLOs.
- Ensure pods define resource requests and limits; otherwise, percentages may be missing or invalid.
- When using PromQL aggregations with denominators, guard against division-by-zero with
clamp_min(...). - Keep the state timeline rows to a manageable number of pods (or use templating/variables) to avoid overcrowding.
State timeline panels are ideal for audiences who need fast visual answers about historical resource states (SREs, on-call engineers, operations leads). Use clear, actionable thresholds and document what each color/state means in your runbooks.
- Grafana — State timeline visualization docs: https://grafana.com/docs/grafana/latest/visualizations/
- Prometheus — PromQL overview: https://prometheus.io/docs/prometheus/latest/querying/basics/
- Kubernetes metrics and resource limits: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/