Ver Fonte

Restore PR 1774 (#1859)

* Restore Network queries to pull/1774

---------

Signed-off-by: Matt Bolt <mbolt35@gmail.com>
Matt Bolt há 3 anos atrás
pai
commit
8f7f71545d
1 ficheiros alterados com 2 adições e 3 exclusões
  1. 2 3
      pkg/costmodel/allocation.go

+ 2 - 3
pkg/costmodel/allocation.go

@@ -40,8 +40,8 @@ const (
 	queryFmtNetRegionCostPerGiB         = `avg(avg_over_time(kubecost_network_region_egress_cost{}[%s])) by (%s)`
 	queryFmtNetInternetGiB              = `sum(increase(kubecost_pod_network_egress_bytes_total{internet="true"}[%s])) by (pod_name, namespace, %s) / 1024 / 1024 / 1024`
 	queryFmtNetInternetCostPerGiB       = `avg(avg_over_time(kubecost_network_internet_egress_cost{}[%s])) by (%s)`
-	queryFmtNetReceiveBytes             = `sum(increase(container_network_receive_bytes_total{pod!="", container="POD"}[%s])) by (pod_name, pod, namespace, %s)`
-	queryFmtNetTransferBytes            = `sum(increase(container_network_transmit_bytes_total{pod!="", container="POD"}[%s])) by (pod_name, pod, namespace, %s)`
+	queryFmtNetReceiveBytes             = `sum(increase(container_network_receive_bytes_total{pod!=""}[%s])) by (pod_name, pod, namespace, %s)`
+	queryFmtNetTransferBytes            = `sum(increase(container_network_transmit_bytes_total{pod!=""}[%s])) by (pod_name, pod, namespace, %s)`
 	queryFmtNodeLabels                  = `avg_over_time(kube_node_labels[%s])`
 	queryFmtNamespaceLabels             = `avg_over_time(kube_namespace_labels[%s])`
 	queryFmtNamespaceAnnotations        = `avg_over_time(kube_namespace_annotations[%s])`
@@ -60,7 +60,6 @@ const (
 	queryFmtOldestSample                = `min_over_time(timestamp(group(node_cpu_hourly_cost))[%s:%s])`
 	queryFmtNewestSample                = `max_over_time(timestamp(group(node_cpu_hourly_cost))[%s:%s])`
 
-
 	// Because we use container_cpu_usage_seconds_total to calculate CPU usage
 	// at any given "instant" of time, we need to use an irate or rate. To then
 	// calculate a max (or any aggregation) we have to perform an aggregation