Causes
Deployment dashboard
The Deployment dashboard allows you to query historical data. You can query historical data by pod name or time range. After you delete a pod, you can still view its historical data in the Deployment dashboard.
This is because the Deployment dashboard uses the label_values(kube_pod_info{namespace=~'$namespace'} ,pod) query statement by default. When the system uses the label_values statement to query data, you can query the pod data by pod name within three days after a pod is deleted. After three days, you can no longer query the pod data by pod name. You can still query the pod data by time range in the Deployment dashboard.
Pod dashboard
- Reason 1: By default, the pod dashboard uses the
query_result(kube_pod_info{namespace=~'$namespace'} >0)query statement. When the system uses thequery_resultquery statement, only the data of running pods is queried. - Reason 2: When you query pods in the Deployment dashboard, you can use the namespace and Deployment as filter conditions. This allows you to quickly view the historical pod data. However, you can use only the namespace as a filter condition in the pod dashboard. It is time-consuming to discover the historical data of specific pods only by namespace. Therefore, the pod dashboard does not support the query of historical pod data.
Example
In this example, the pod suffixed with hxv and the pod suffixed with wcc are deleted. The monitoring data of the Deployment dashboard and the pod dashboard is displayed.
Deployment dashboard
hxv and the pod suffixed with wcc in the Deployment dashboard. The pod information will disappear from the Pod drop-down list (Icon 1) after three business days.
Pod dashboard
hxv and the pod suffixed with wcc disappear from the Pod drop-down list (Icon 1) 5 minutes after they are deleted, as shown in the following figure. Therefore, you cannot query the historical pod data by pod name.