Skip to content

Commit

Permalink
Merge pull request #150 from project-koku/cost-2285-downstream
Browse files Browse the repository at this point in the history
[COST-2285] - downstream - fix many-to-many error
  • Loading branch information
maskarb authored Oct 11, 2022
2 parents 0159d5e + 029919b commit 6d38c76
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 6d38c76

Please sign in to comment.