mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
[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:
parent
e34df0a26c
commit
a1174b08a6
@ -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()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user