From f5329b2feb818ae7c0bbb3b28774f73bdabd1405 Mon Sep 17 00:00:00 2001 From: Oleksandr Turytsia Date: Mon, 6 Jan 2025 15:25:20 +0100 Subject: [PATCH] fix --- deploy/helm/events-collector-config.yaml | 6 ++++ deploy/helm/metrics-collector-config.yaml | 3 -- ...events-collector-config-map_test.yaml.snap | 36 +++++++++++++++++++ ...ollector-config-map-fargate_test.yaml.snap | 3 -- ...etrics-collector-config-map_test.yaml.snap | 9 ----- 5 files changed, 42 insertions(+), 15 deletions(-) diff --git a/deploy/helm/events-collector-config.yaml b/deploy/helm/events-collector-config.yaml index ae9f52bc..411a13ee 100644 --- a/deploy/helm/events-collector-config.yaml +++ b/deploy/helm/events-collector-config.yaml @@ -100,6 +100,9 @@ processors: - delete_key(resource.attributes, "k8s.job.name") where resource.attributes["sw.k8s.job.found"] == "false" - delete_key(resource.attributes, "k8s.cronjob.name") where resource.attributes["sw.k8s.cronjob.found"] == "false" - delete_key(resource.attributes, "k8s.node.name") where resource.attributes["sw.k8s.node.found"] == "false" + - delete_key(resource.attributes, "k8s.persistentvolume.name") where resource.attributes["sw.k8s.persistentvolume.found"] == "false" + - delete_key(resource.attributes, "k8s.persistentvolumeclaim.name") where resource.attributes["sw.k8s.persistentvolumeclaim.found"] == "false" + - delete_key(resource.attributes, "k8s.service.name") where resource.attributes["sw.k8s.service.found"] == "false" - delete_key(resource.attributes, "sw.k8s.pod.found") - delete_key(resource.attributes, "sw.k8s.deployment.found") - delete_key(resource.attributes, "sw.k8s.statefulset.found") @@ -108,6 +111,9 @@ processors: - delete_key(resource.attributes, "sw.k8s.job.found") - delete_key(resource.attributes, "sw.k8s.cronjob.found") - delete_key(resource.attributes, "sw.k8s.node.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") + - delete_key(resource.attributes, "sw.k8s.service.found") transform/stringify_body: error_mode: ignore diff --git a/deploy/helm/metrics-collector-config.yaml b/deploy/helm/metrics-collector-config.yaml index a6f383f9..013e873d 100644 --- a/deploy/helm/metrics-collector-config.yaml +++ b/deploy/helm/metrics-collector-config.yaml @@ -751,9 +751,6 @@ processors: - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") - delete_key(resource.attributes, "sw.k8s.service.found") - - delete_key(resource.attributes, "sw.k8s.job.found") - - delete_key(resource.attributes, "sw.k8s.cronjob.found") - - delete_key(resource.attributes, "sw.k8s.node.found") attributes/remove_prometheus_attributes_endpoint: exclude: diff --git a/deploy/helm/tests/__snapshot__/events-collector-config-map_test.yaml.snap b/deploy/helm/tests/__snapshot__/events-collector-config-map_test.yaml.snap index 22f56557..65b1fa8b 100644 --- a/deploy/helm/tests/__snapshot__/events-collector-config-map_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/events-collector-config-map_test.yaml.snap @@ -241,6 +241,12 @@ Custom events filter with new syntax: == "false" - delete_key(resource.attributes, "k8s.node.name") where resource.attributes["sw.k8s.node.found"] == "false" + - delete_key(resource.attributes, "k8s.persistentvolume.name") where resource.attributes["sw.k8s.persistentvolume.found"] + == "false" + - delete_key(resource.attributes, "k8s.persistentvolumeclaim.name") where resource.attributes["sw.k8s.persistentvolumeclaim.found"] + == "false" + - delete_key(resource.attributes, "k8s.service.name") where resource.attributes["sw.k8s.service.found"] + == "false" - delete_key(resource.attributes, "sw.k8s.pod.found") - delete_key(resource.attributes, "sw.k8s.deployment.found") - delete_key(resource.attributes, "sw.k8s.statefulset.found") @@ -249,6 +255,9 @@ Custom events filter with new syntax: - delete_key(resource.attributes, "sw.k8s.job.found") - delete_key(resource.attributes, "sw.k8s.cronjob.found") - delete_key(resource.attributes, "sw.k8s.node.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") + - delete_key(resource.attributes, "sw.k8s.service.found") transform/entity_attributes: log_statements: - context: log @@ -821,6 +830,12 @@ Custom events filter with old syntax: == "false" - delete_key(resource.attributes, "k8s.node.name") where resource.attributes["sw.k8s.node.found"] == "false" + - delete_key(resource.attributes, "k8s.persistentvolume.name") where resource.attributes["sw.k8s.persistentvolume.found"] + == "false" + - delete_key(resource.attributes, "k8s.persistentvolumeclaim.name") where resource.attributes["sw.k8s.persistentvolumeclaim.found"] + == "false" + - delete_key(resource.attributes, "k8s.service.name") where resource.attributes["sw.k8s.service.found"] + == "false" - delete_key(resource.attributes, "sw.k8s.pod.found") - delete_key(resource.attributes, "sw.k8s.deployment.found") - delete_key(resource.attributes, "sw.k8s.statefulset.found") @@ -829,6 +844,9 @@ Custom events filter with old syntax: - delete_key(resource.attributes, "sw.k8s.job.found") - delete_key(resource.attributes, "sw.k8s.cronjob.found") - delete_key(resource.attributes, "sw.k8s.node.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") + - delete_key(resource.attributes, "sw.k8s.service.found") transform/entity_attributes: log_statements: - context: log @@ -1394,6 +1412,12 @@ Events config should match snapshot when using default values: == "false" - delete_key(resource.attributes, "k8s.node.name") where resource.attributes["sw.k8s.node.found"] == "false" + - delete_key(resource.attributes, "k8s.persistentvolume.name") where resource.attributes["sw.k8s.persistentvolume.found"] + == "false" + - delete_key(resource.attributes, "k8s.persistentvolumeclaim.name") where resource.attributes["sw.k8s.persistentvolumeclaim.found"] + == "false" + - delete_key(resource.attributes, "k8s.service.name") where resource.attributes["sw.k8s.service.found"] + == "false" - delete_key(resource.attributes, "sw.k8s.pod.found") - delete_key(resource.attributes, "sw.k8s.deployment.found") - delete_key(resource.attributes, "sw.k8s.statefulset.found") @@ -1402,6 +1426,9 @@ Events config should match snapshot when using default values: - delete_key(resource.attributes, "sw.k8s.job.found") - delete_key(resource.attributes, "sw.k8s.cronjob.found") - delete_key(resource.attributes, "sw.k8s.node.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") + - delete_key(resource.attributes, "sw.k8s.service.found") transform/entity_attributes: log_statements: - context: log @@ -1966,6 +1993,12 @@ Events config should not contain manifest collection pipeline when disabled: == "false" - delete_key(resource.attributes, "k8s.node.name") where resource.attributes["sw.k8s.node.found"] == "false" + - delete_key(resource.attributes, "k8s.persistentvolume.name") where resource.attributes["sw.k8s.persistentvolume.found"] + == "false" + - delete_key(resource.attributes, "k8s.persistentvolumeclaim.name") where resource.attributes["sw.k8s.persistentvolumeclaim.found"] + == "false" + - delete_key(resource.attributes, "k8s.service.name") where resource.attributes["sw.k8s.service.found"] + == "false" - delete_key(resource.attributes, "sw.k8s.pod.found") - delete_key(resource.attributes, "sw.k8s.deployment.found") - delete_key(resource.attributes, "sw.k8s.statefulset.found") @@ -1974,6 +2007,9 @@ Events config should not contain manifest collection pipeline when disabled: - delete_key(resource.attributes, "sw.k8s.job.found") - delete_key(resource.attributes, "sw.k8s.cronjob.found") - delete_key(resource.attributes, "sw.k8s.node.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") + - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") + - delete_key(resource.attributes, "sw.k8s.service.found") transform/entity_attributes: log_statements: - context: log diff --git a/deploy/helm/tests/__snapshot__/metrics-collector-config-map-fargate_test.yaml.snap b/deploy/helm/tests/__snapshot__/metrics-collector-config-map-fargate_test.yaml.snap index 3c3ec205..c186444a 100644 --- a/deploy/helm/tests/__snapshot__/metrics-collector-config-map-fargate_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/metrics-collector-config-map-fargate_test.yaml.snap @@ -1592,9 +1592,6 @@ Metrics config should match snapshot when using default values: - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") - delete_key(resource.attributes, "sw.k8s.service.found") - - delete_key(resource.attributes, "sw.k8s.job.found") - - delete_key(resource.attributes, "sw.k8s.cronjob.found") - - delete_key(resource.attributes, "sw.k8s.node.found") transform/scope: metric_statements: - context: scope diff --git a/deploy/helm/tests/__snapshot__/metrics-collector-config-map_test.yaml.snap b/deploy/helm/tests/__snapshot__/metrics-collector-config-map_test.yaml.snap index 629bf3e6..1d4b3096 100644 --- a/deploy/helm/tests/__snapshot__/metrics-collector-config-map_test.yaml.snap +++ b/deploy/helm/tests/__snapshot__/metrics-collector-config-map_test.yaml.snap @@ -1592,9 +1592,6 @@ Metrics config should match snapshot when fargate is enabled: - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") - delete_key(resource.attributes, "sw.k8s.service.found") - - delete_key(resource.attributes, "sw.k8s.job.found") - - delete_key(resource.attributes, "sw.k8s.cronjob.found") - - delete_key(resource.attributes, "sw.k8s.node.found") transform/scope: metric_statements: - context: scope @@ -3454,9 +3451,6 @@ Metrics config should match snapshot when using Prometheus url with extra_scrape - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") - delete_key(resource.attributes, "sw.k8s.service.found") - - delete_key(resource.attributes, "sw.k8s.job.found") - - delete_key(resource.attributes, "sw.k8s.cronjob.found") - - delete_key(resource.attributes, "sw.k8s.node.found") transform/scope: metric_statements: - context: scope @@ -5258,9 +5252,6 @@ Metrics config should match snapshot when using default values: - delete_key(resource.attributes, "sw.k8s.persistentvolume.found") - delete_key(resource.attributes, "sw.k8s.persistentvolumeclaim.found") - delete_key(resource.attributes, "sw.k8s.service.found") - - delete_key(resource.attributes, "sw.k8s.job.found") - - delete_key(resource.attributes, "sw.k8s.cronjob.found") - - delete_key(resource.attributes, "sw.k8s.node.found") transform/scope: metric_statements: - context: scope