Bladeren bron

Merge branch 'develop' into saweber/timeutil-week

Sean Holcomb 3 jaren geleden
bovenliggende
commit
b51f2a2158
5 gewijzigde bestanden met toevoegingen van 6 en 13 verwijderingen
  1. 2 1
      ROADMAP.md
  2. 1 1
      docs/swagger.json
  3. 2 2
      pkg/costmodel/allocation.go
  4. 1 1
      pkg/costmodel/router.go
  5. 0 8
      pkg/env/costmodelenv.go

+ 2 - 1
ROADMAP.md

@@ -4,7 +4,8 @@ __2022 roadmap__
 
 * Improved testing frameworks for backend APIs as well as frontend UI
 * Add conformance tests to confirm implementation meets standards
-* Deeper billing integrations with other cloud providers
+* Deeper billing integrations with other cloud providers, e.g. Alibaba
+* Add external cloud cost monitoring
 * More accessible & improved user interface
 * Improved support from open source community helm chart
 * More robust API documentation

+ 1 - 1
docs/swagger.json

@@ -69,7 +69,7 @@
           {
           "name": "aggregate",
           "in": "query",
-          "description": "Field by which to aggregate the results. Accepts: `cluster`, `namespace`, `controllerKind`, `controller`, `service`, `label:<name>`, and `annotation:<name>`. Also accepts comma-separated lists for multi-aggregation, like `namespace,label:app`.",
+          "description": "Field by which to aggregate the results. Accepts: `cluster`, `node`, `namespace`, `controllerKind`, `controller`, `service`, `pod`, `container`, `label:<name>`, and `annotation:<name>`. Also accepts comma-separated lists for multi-aggregation, like `namespace,label:app`.",
           "required": false,
           "style": "form",
           "explode": true,

+ 2 - 2
pkg/costmodel/allocation.go

@@ -41,8 +41,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])`

+ 1 - 1
pkg/costmodel/router.go

@@ -1482,7 +1482,7 @@ func Initialize(additionalConfigWatchers ...*watcher.ConfigMapWatcher) *Accesses
 
 	var err error
 	if errorReportingEnabled {
-		err = sentry.Init(sentry.ClientOptions{Release: env.GetAppVersion()})
+		err = sentry.Init(sentry.ClientOptions{Release: version.FriendlyVersion()})
 		if err != nil {
 			log.Infof("Failed to initialize sentry for error reporting")
 		} else {

+ 0 - 8
pkg/env/costmodelenv.go

@@ -10,8 +10,6 @@ import (
 )
 
 const (
-	AppVersionEnvVar = "APP_VERSION"
-
 	AWSAccessKeyIDEnvVar     = "AWS_ACCESS_KEY_ID"
 	AWSAccessKeySecretEnvVar = "AWS_SECRET_ACCESS_KEY"
 	AWSClusterIDEnvVar       = "AWS_CLUSTER_ID"
@@ -171,12 +169,6 @@ func GetMetricsConfigmapName() string {
 	return Get(MetricsConfigmapName, "metrics-config")
 }
 
-// GetAWSAccessKeyID returns the environment variable value for AWSAccessKeyIDEnvVar which represents
-// the AWS access key for authentication
-func GetAppVersion() string {
-	return Get(AppVersionEnvVar, "1.91.0-rc.0")
-}
-
 // IsEmitNamespaceAnnotationsMetric returns true if cost-model is configured to emit the kube_namespace_annotations metric
 // containing the namespace annotations
 func IsEmitNamespaceAnnotationsMetric() bool {