[prometheus addon] Add filter on image in tests to remove pod timeseries
New pod timeseries was introduced that has same labels for namespace and pod_name resulting in doubling value in old query. New metric is not based on containers so filtering on image solves that problem.
This commit is contained in:
		| @@ -91,7 +91,7 @@ var _ = instrumentation.SIGDescribe("[Feature:PrometheusMonitoring] Prometheus", | |||||||
| }) | }) | ||||||
|  |  | ||||||
| func prometheusCPUQuery(namespace, podNamePrefix string, rate time.Duration) string { | func prometheusCPUQuery(namespace, podNamePrefix string, rate time.Duration) string { | ||||||
| 	return fmt.Sprintf(`sum(irate(container_cpu_usage_seconds_total{namespace="%v",pod_name=~"%v.*"}[%vm]))`, | 	return fmt.Sprintf(`sum(irate(container_cpu_usage_seconds_total{namespace="%v",pod_name=~"%v.*",image!=""}[%vm]))`, | ||||||
| 		namespace, podNamePrefix, int64(rate.Minutes())) | 		namespace, podNamePrefix, int64(rate.Minutes())) | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Marek Siarkowicz
					Marek Siarkowicz