Skip to content

Commit 6e191f5

Browse files
authored
Fix Looking For Old Metrics For EKS Fargate Container Metrics (#436)
1 parent 5aaddce commit 6e191f5

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

terraform/eks/container-insights-agent/config_map_fargate.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ data:
337337
metric1: pod_network_rx_bytes
338338
metric2: pod_network_tx_bytes
339339
operation: add
340-
- name: pod_memory_utilization_over_pod_limit
340+
- name: pod_memory_utilization_over_pod_limit_${TestingId}
341341
unit: Percent
342342
type: calculate
343343
metric1: pod_memory_working_set
@@ -360,7 +360,7 @@ data:
360360
361361
experimental_metricsgeneration/2:
362362
rules:
363-
- name: pod_cpu_utilization_over_pod_limit
363+
- name: pod_cpu_utilization_over_pod_limit_${TestingId}
364364
type: calculate
365365
unit: Percent
366366
metric1: pod_cpu_usage_total
@@ -420,8 +420,8 @@ data:
420420
metric_declarations:
421421
- dimensions: [ [ClusterName, LaunchType], [ClusterName, Namespace, LaunchType], [ClusterName, Namespace, PodName, LaunchType]]
422422
metric_name_selectors:
423-
- pod_cpu_utilization_over_pod_limit
424-
- pod_memory_utilization_over_pod_limit
423+
- pod_cpu_utilization_over_pod_limit_${TestingId}
424+
- pod_memory_utilization_over_pod_limit_${TestingId}
425425
- pod_memory_working_set
426426
- pod_memory_limit
427427
- pod_network_rx_bytes

terraform/eks/container_insights_agent.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,12 @@ resource "kubectl_manifest" "cluster_role_binding" {
6666
}
6767

6868
resource "kubectl_manifest" "config_map" {
69-
count = 1
70-
yaml_body = var.deployment_type == "fargate" ? templatefile("./container-insights-agent/config_map_fargate.yml", { Namespace : tolist(aws_eks_fargate_profile.test_profile[count.index].selector)[0].namespace }) : data.template_file.config_map_file[count.index].rendered
69+
count = 1
70+
yaml_body = var.deployment_type == "fargate" ? templatefile("./container-insights-agent/config_map_fargate.yml",
71+
{
72+
Namespace : tolist(aws_eks_fargate_profile.test_profile[count.index].selector)[0].namespace,
73+
TestingId : module.common.testing_id
74+
}) : data.template_file.config_map_file[count.index].rendered
7175
depends_on = [aws_eks_fargate_profile.test_profile]
7276
}
7377

validator/src/main/resources/expected-data-template/EKSFargateCWCIExpectedMetric.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-
2-
metricName: pod_cpu_utilization_over_pod_limit
2+
metricName: pod_cpu_utilization_over_pod_limit_{{testingId}}
33
namespace: ContainerInsightsFargate
44
dimensions:
55
-
@@ -29,7 +29,7 @@
2929
name: LaunchType
3030
value: fargate
3131
-
32-
metricName: pod_memory_utilization_over_pod_limit
32+
metricName: pod_memory_utilization_over_pod_limit_{{testingId}}
3333
namespace: ContainerInsightsFargate
3434
dimensions:
3535
-
@@ -98,7 +98,7 @@
9898
name: Namespace
9999
value: SKIP
100100
-
101-
metricName: pod_memory_utilization_over_pod_limit
101+
metricName: pod_memory_utilization_over_pod_limit_{{testingId}}
102102
namespace: ContainerInsightsFargate
103103
dimensions:
104104
-
@@ -185,7 +185,7 @@
185185
name: PodName
186186
value: SKIP
187187
-
188-
metricName: pod_memory_utilization_over_pod_limit
188+
metricName: pod_memory_utilization_over_pod_limit_{{testingId}}
189189
namespace: ContainerInsightsFargate
190190
dimensions:
191191
-

0 commit comments

Comments
 (0)