Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[COST-2285] - downstream - fix many-to-many error #150

Merged
merged 5 commits into from
Oct 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions collector/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ var (
podQueries = &querys{
query{
Name: "pod-limit-cpu-cores",
QueryString: "sum(kube_pod_container_resource_limits{resource='cpu',namespace!='',node!='',pod!=''} * on(pod, namespace) group_left kube_pod_status_phase{phase='Running'}) without (container, instance, uid)",
QueryString: "sum by (namespace, node, pod) (kube_pod_container_resource_limits{resource='cpu',namespace!='',node!='',pod!=''} * on(namespace, pod) group_left() max by (namespace, pod) (kube_pod_status_phase{phase='Running'}))",
MetricKey: staticFields{"pod": "pod", "namespace": "namespace", "node": "node"},
QueryValue: &saveQueryValue{
ValName: "pod-limit-cpu-cores",
Expand All @@ -139,7 +139,7 @@ var (
},
query{
Name: "pod-limit-memory-bytes",
QueryString: "sum(kube_pod_container_resource_limits{resource='memory',namespace!='',node!='',pod!=''} * on(pod, namespace) group_left kube_pod_status_phase{phase='Running'}) without (container, instance, uid)",
QueryString: "sum by (namespace, node, pod) (kube_pod_container_resource_limits{resource='memory',namespace!='',node!='',pod!=''} * on(namespace, pod) group_left() max by (namespace, pod) (kube_pod_status_phase{phase='Running'}))",
MetricKey: staticFields{"pod": "pod", "namespace": "namespace", "node": "node"},
QueryValue: &saveQueryValue{
ValName: "pod-limit-memory-bytes",
Expand All @@ -151,7 +151,7 @@ var (
},
query{
Name: "pod-request-cpu-cores",
QueryString: "sum(kube_pod_container_resource_requests{resource='cpu',namespace!='',node!='',pod!=''} * on(pod, namespace) group_left kube_pod_status_phase{phase='Running'}) without (container, instance, uid)",
QueryString: "sum by (namespace, node, pod) (kube_pod_container_resource_requests{resource='cpu',namespace!='',node!='',pod!=''} * on(namespace, pod) group_left() max by (namespace, pod) (kube_pod_status_phase{phase='Running'}))",
MetricKey: staticFields{"pod": "pod", "namespace": "namespace", "node": "node"},
QueryValue: &saveQueryValue{
ValName: "pod-request-cpu-cores",
Expand All @@ -163,7 +163,7 @@ var (
},
query{
Name: "pod-request-memory-bytes",
QueryString: "sum(kube_pod_container_resource_requests{resource='memory',namespace!='',node!='',pod!=''} * on(pod, namespace) group_left kube_pod_status_phase{phase='Running'}) without (container, instance, uid)",
QueryString: "sum by (namespace, node, pod) (kube_pod_container_resource_requests{resource='memory',namespace!='',node!='',pod!=''} * on(namespace, pod) group_left() max by (namespace, pod) (kube_pod_status_phase{phase='Running'}))",
MetricKey: staticFields{"pod": "pod", "namespace": "namespace", "node": "node"},
QueryValue: &saveQueryValue{
ValName: "pod-request-memory-bytes",
Expand All @@ -175,7 +175,7 @@ var (
},
query{
Name: "pod-usage-cpu-cores",
QueryString: "sum(rate(container_cpu_usage_seconds_total{container!='POD',container!='',namespace!='',node!='',pod!=''}[5m])) without (container, instance, uid)",
QueryString: "sum by (namespace, node, pod) (rate(container_cpu_usage_seconds_total{container!='POD',container!='',namespace!='',node!='',pod!=''}[5m]))",
MetricKey: staticFields{"pod": "pod", "namespace": "namespace", "node": "node"},
QueryValue: &saveQueryValue{
ValName: "pod-usage-cpu-cores",
Expand All @@ -187,7 +187,7 @@ var (
},
query{
Name: "pod-usage-memory-bytes",
QueryString: "sum(container_memory_usage_bytes{container!='POD',container!='',namespace!='',node!='',pod!=''}) without (container, instance, uid)",
QueryString: "sum by (namespace, node, pod) (container_memory_usage_bytes{container!='POD',container!='',namespace!='',node!='',pod!=''})",
MetricKey: staticFields{"pod": "pod", "namespace": "namespace", "node": "node"},
QueryValue: &saveQueryValue{
ValName: "pod-usage-memory-bytes",
Expand Down