adapted to kubelet 1.16

This commit is contained in:
glyasai 2020-02-13 20:51:19 +08:00
parent 2c3cf4cb39
commit ab08a1074f

View File

@ -1762,7 +1762,7 @@ func (s *ServiceAction) GetPodContainerMemory(podNames []string) (map[string]map
memoryUsageMap := make(map[string]map[string]string, 10)
proxy := GetPrometheusProxy()
queryName := strings.Join(podNames, "|")
query := fmt.Sprintf(`container_memory_rss{pod_name=~"%s"}`, queryName)
query := fmt.Sprintf(`container_memory_rss{pod=~"%s"}`, queryName)
proQuery := strings.Replace(query, " ", "%20", -1)
req, err := http.NewRequest("GET", fmt.Sprintf("http://127.0.0.1:9999/api/v1/query?query=%s", proQuery), nil)
if err != nil {