diff --git a/deploy/helm/events-collector-config.yaml b/deploy/helm/events-collector-config.yaml index 20f9bcbb..01c289fc 100644 --- a/deploy/helm/events-collector-config.yaml +++ b/deploy/helm/events-collector-config.yaml @@ -116,6 +116,12 @@ processors: statements: # convert body to string - set(body, body.string) + transform/set_status_for_pods: + error_mode: ignore + log_statements: + - context: log + statements: + - set(resource.attributes["sw.k8s.pod.status"], body["status"]["phase"]) where body["kind"] == "Pod" and body["status"]["phase"] != nil transform/set_labels_and_annotations_for_entities: error_mode: ignore @@ -325,6 +331,7 @@ service: - transform/manifest - groupbyattrs/manifest - transform/set_labels_and_annotations_for_entities + - transform/set_status_for_pods - transform/stringify_body - resource/manifest - swk8sattributes 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 26c23917..53e79990 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 @@ -376,6 +376,13 @@ Custom events filter with new syntax: or body["kind"] == "PersistentVolume" or body["kind"] == "Pod" or body["kind"] == "ReplicaSet" or body["kind"] == "Service" or body["kind"] == "StatefulSet") and cache["labels"] != nil + transform/set_status_for_pods: + error_mode: ignore + log_statements: + - context: log + statements: + - set(resource.attributes["sw.k8s.pod.status"], body["status"]["phase"]) where + body["kind"] == "Pod" and body["status"]["phase"] != nil transform/severity: log_statements: - context: log @@ -526,6 +533,7 @@ Custom events filter with new syntax: - transform/manifest - groupbyattrs/manifest - transform/set_labels_and_annotations_for_entities + - transform/set_status_for_pods - transform/stringify_body - resource/manifest - swk8sattributes @@ -920,6 +928,13 @@ Custom events filter with old syntax: or body["kind"] == "PersistentVolume" or body["kind"] == "Pod" or body["kind"] == "ReplicaSet" or body["kind"] == "Service" or body["kind"] == "StatefulSet") and cache["labels"] != nil + transform/set_status_for_pods: + error_mode: ignore + log_statements: + - context: log + statements: + - set(resource.attributes["sw.k8s.pod.status"], body["status"]["phase"]) where + body["kind"] == "Pod" and body["status"]["phase"] != nil transform/severity: log_statements: - context: log @@ -1070,6 +1085,7 @@ Custom events filter with old syntax: - transform/manifest - groupbyattrs/manifest - transform/set_labels_and_annotations_for_entities + - transform/set_status_for_pods - transform/stringify_body - resource/manifest - swk8sattributes @@ -1457,6 +1473,13 @@ Events config should match snapshot when using default values: or body["kind"] == "PersistentVolume" or body["kind"] == "Pod" or body["kind"] == "ReplicaSet" or body["kind"] == "Service" or body["kind"] == "StatefulSet") and cache["labels"] != nil + transform/set_status_for_pods: + error_mode: ignore + log_statements: + - context: log + statements: + - set(resource.attributes["sw.k8s.pod.status"], body["status"]["phase"]) where + body["kind"] == "Pod" and body["status"]["phase"] != nil transform/severity: log_statements: - context: log @@ -1606,6 +1629,7 @@ Events config should match snapshot when using default values: - transform/manifest - groupbyattrs/manifest - transform/set_labels_and_annotations_for_entities + - transform/set_status_for_pods - transform/stringify_body - resource/manifest - swk8sattributes @@ -1993,6 +2017,13 @@ Events config should not contain manifest collection pipeline when disabled: or body["kind"] == "PersistentVolume" or body["kind"] == "Pod" or body["kind"] == "ReplicaSet" or body["kind"] == "Service" or body["kind"] == "StatefulSet") and cache["labels"] != nil + transform/set_status_for_pods: + error_mode: ignore + log_statements: + - context: log + statements: + - set(resource.attributes["sw.k8s.pod.status"], body["status"]["phase"]) where + body["kind"] == "Pod" and body["status"]["phase"] != nil transform/severity: log_statements: - context: log @@ -2082,6 +2113,7 @@ Events config should not contain manifest collection pipeline when disabled: - transform/manifest - groupbyattrs/manifest - transform/set_labels_and_annotations_for_entities + - transform/set_status_for_pods - transform/stringify_body - resource/manifest - swk8sattributes