Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read pod status from manifests #853

Merged
merged 7 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions deploy/helm/events-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading