瀏覽代碼

Update CloudCost service categorization. GuardDuty should not be
classified as "Compute", but instead as "Other".

Signed-off-by: thomasvn <thomasnguyen96@gmail.com>

thomasvn 2 年之前
父節點
當前提交
d537f4b517
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      pkg/cloud/aws/athenaquerier.go

+ 4 - 0
pkg/cloud/aws/athenaquerier.go

@@ -208,6 +208,10 @@ func SelectAWSCategory(providerID, usageType, service string) string {
 	// The node and volume conditions are mutually exclusive.
 	// Provider ID has prefix "i-"
 	if strings.HasPrefix(providerID, "i-") {
+		// GuardDuty has a ProviderID prefix of "i-", but should not be categorized as compute
+		if strings.ToUpper(service) == "AMAZONGUARDDUTY" {
+			return opencost.OtherCategory
+		}
 		return opencost.ComputeCategory
 	}
 	// Provider ID has prefix "vol-"