<p>The metrics for deleted pods still exists on the Prometheus Time Series Database. The problem is that the Grafana dashboards imported from <a href="https://github.com/kubernetes-monitoring/kubernetes-mixin" rel="noreferrer">kubernetes-mixin</a> create the pod list when loading the dashboards.</p>

<p>To change this in Grafana, open the <code>Variables</code> menu, then change <code>$pod</code> variable to refresh <code>On Time Range Change</code>:</p>

<p><a href="https://i.sstatic.net/qStHB.png" rel="noreferrer"><img src="https://i.sstatic.net/qStHB.png" alt="enter image description here"></a></p>

<p>Go back to the panels and change the time range (e.g., to "This Month"). The deleted pods for that period should be listed in the dropdown menu.</p>

CC BY-SA 4.0
2019-04-02T00:00:16.030Z
2019-04-02T00:00:16.030Z
Eduardo Baitello
<p>I love using Prometheus/Grafana to monitor and tune resource usage on my Kubernetes clusters. When pods are terminated, however, the graphs are disposed of it seems.</p>

<p>I am looking for a solution to this problem.</p>

<p>For informed decisions on how to tune resource requests I need history to be kept.</p>

<p>Does anybody know how to keep graphs for deleted Kubernetes pods in Prometheus/Grafana.</p>

<p>I am currently using this deployment:
<a href="https://itnext.io/kubernetes-monitoring-with-prometheus-in-15-minutes-8e54d1de2e13" rel="nofollow noreferrer">https://itnext.io/kubernetes-monitoring-with-prometheus-in-15-minutes-8e54d1de2e13</a></p>

<kubernetes><prometheus><grafana>
Keeping graphs of terminated Kubernetes pods in Prometheus/Grafana
David West
# Keeping graphs of terminated Kubernetes pods in Prometheus/Grafana

(Asked by: username_0 on 2019-02-08)

I love using Prometheus/Grafana to monitor and tune resource usage on my Kubernetes clusters. When pods are terminated, however, the graphs are disposed of it seems.

I am looking for a solution to this problem.

For informed decisions on how to tune resource requests I need history to be kept.

Does anybody know how to keep graphs for deleted Kubernetes pods in Prometheus/Grafana.

I am currently using this deployment:
<https://itnext.io/kubernetes-monitoring-with-prometheus-in-15-minutes-8e54d1de2e13>

**Tags:** kubernetes, prometheus, grafana


---

## 1 answers

### Answer by username_1 on 2019-04-02. Score: 5

The metrics for deleted pods still exists on the Prometheus Time Series Database. The problem is that the Grafana dashboards imported from [kubernetes-mixin](https://github.com/kubernetes-monitoring/kubernetes-mixin) create the pod list when loading the dashboards.

To change this in Grafana, open the `Variables` menu, then change `$pod` variable to refresh `On Time Range Change`:

[![enter image description here](https://i.sstatic.net/qStHB.png)](https://i.sstatic.net/qStHB.png)

Go back to the panels and change the time range (e.g., to "This Month"). The deleted pods for that period should be listed in the dropdown menu.


---

