From 28f4d65ffe0538135cae3b083b3dbc8e4779bc05 Mon Sep 17 00:00:00 2001 From: Andre Ziviani Date: Fri, 30 Dec 2022 10:54:37 -0300 Subject: [PATCH] fix: Swap kind and type values --- README.md | 10 +++++----- exporter/ondemand.go | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a65b1ea..7c7037b 100644 --- a/README.md +++ b/README.md @@ -5,12 +5,12 @@ Expose the cost of each pod relative to the cost of the instance that it is runn ``` eks_cost_pod_cpu{kind="fargate",namespace="kube-system",pod="coredns-687d8ddc5b-psk7t",type="fargate"} 0.00020879999999999998 -eks_cost_pod_memory{kind="fargate",namespace="kube-system",pod="coredns-687d8ddc5b-psk7t",type="fargate"} 0.00013095550537109375 -eks_cost_pod_total{kind="fargate",namespace="kube-system",pod="coredns-687d8ddc5b-psk7t",type="fargate"} 0.00033975550537109373 +eks_cost_pod_memory{kind="fargate",namespace="kube-system",pod="coredns-687d8ddc5b-psk7t",type="fargate"} 0.000132550048828125 +eks_cost_pod_total{kind="fargate",namespace="kube-system",pod="coredns-687d8ddc5b-psk7t",type="fargate"} 0.00034135004882812495 ... -eks_cost_pod_cpu{kind="m6i.xlarge",namespace="kube-system",pod="aws-node-4mqg5",type="ec2"} 9.835714285714287e-05 -eks_cost_pod_memory{kind="m6i.xlarge",namespace="kube-system",pod="aws-node-4mqg5",type="ec2"} 0.0002456796169281006 -eks_cost_pod_total{kind="m6i.xlarge",namespace="kube-system",pod="aws-node-4mqg5",type="ec2"} 0.0003440367597852435 +eks_cost_pod_cpu{kind="ec2",namespace="kube-system",pod="aws-node-4mqg5",type="m6i.xlarge"} 0.0001475357142857143 +eks_cost_pod_memory{kind="ec2",namespace="kube-system",pod="aws-node-4mqg5",type="m6i.xlarge"} 0.0002456796169281006 +eks_cost_pod_total{kind="ec2",namespace="kube-system",pod="aws-node-4mqg5",type="m6i.xlarge"} 0.00039321533121381493 ``` # permissions diff --git a/exporter/ondemand.go b/exporter/ondemand.go index 843105c..7c83f10 100644 --- a/exporter/ondemand.go +++ b/exporter/ondemand.go @@ -46,8 +46,8 @@ func (m *Metrics) getInstances(ctx context.Context) { m.Instances[string(instance.InstanceType)] = &Instance{ Memory: aws.ToInt64(instance.MemoryInfo.SizeInMiB), VCpu: aws.ToInt32(instance.VCpuInfo.DefaultVCpus), - Type: "ec2", - Kind: string(instance.InstanceType), + Kind: "ec2", + Type: string(instance.InstanceType), } } }