Skip to content

Commit

Permalink
Merge pull request #853 from solarwinds/read-pod-status-from-events
Browse files Browse the repository at this point in the history
Read pod status from manifests
  • Loading branch information
turytsia authored Jan 7, 2025
2 parents 6c8b440 + a17f16c commit 608fcd9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deploy/helm/events-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,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 @@ -369,6 +375,7 @@ service:
- transform/manifest
- groupbyattrs/manifest
- transform/set_labels_and_annotations_for_entities
- transform/set_status_for_pods
- transform/stringify_body
- resource/manifest
- resourcedetection/providers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,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 @@ -570,6 +577,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
- resourcedetection/providers
Expand Down Expand Up @@ -1009,6 +1017,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 @@ -1159,6 +1174,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
- resourcedetection/providers
Expand Down Expand Up @@ -1591,6 +1607,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 @@ -1740,6 +1763,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
- resourcedetection/providers
Expand Down Expand Up @@ -2172,6 +2196,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 @@ -2261,6 +2292,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
- resourcedetection/providers
Expand Down

0 comments on commit 608fcd9

Please sign in to comment.