Skip to content

fix(k8sevent): link container fieldPath and source.host events to Container and Node timelines - #1197

Merged
kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-ymtypymmvvtl
Oct 29, 2026
Merged

kyasbal merged 2 commits into
GoogleCloudPlatform:mainfrom
kyasbal:push-ymtypymmvvtl

Conversation

@kyasbal

@kyasbal kyasbal commented Oct 29, 2026

Copy link
Copy Markdown
Member

Fixes #1196

Summary

Kubernetes Event logs (k8s_event) emitted by kubelet for container lifecycle and health probes (Pulling, Pulled, Created, Started, Unhealthy, Killing, BackOff) specify the target container in jsonPayload.involvedObject.fieldPath (spec.containers{<name>}, spec.initContainers{<name>}, or spec.ephemeralContainers{<name>}) and the reporting node in jsonPayload.source.host, but were previously only mapped to the parent Pod timeline.

This change extracts jsonPayload.involvedObject.fieldPath into KubernetesEventFieldSet.FieldPath and updates mapK8sEventLog to:

  • Attach Pod events with a container fieldPath to the corresponding child [container] timeline (k8saudit.MustK8sContainerTimeline).
  • Attach events with a non-empty source.host to the core/v1#node#cluster-scope#<source-host> timeline.
@kyasbal kyasbal added type:bug Something isn't working as expected area:backend-parser Log parsers and log timeline mapper tasks labels Oct 29, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds extraction of the 'fieldPath' from Kubernetes events to map pod events to their specific container timelines (including standard, init, and ephemeral containers). It also maps events with a 'SourceHost' to their corresponding node timelines. The review feedback suggests optimizing the node timeline mapping to avoid redundant path resolution and allocations when the event is already a node event.

@kyasbal
kyasbal added this pull request to the merge queue Oct 29, 2026
Merged via the queue into GoogleCloudPlatform:main with commit 3df3a10 Oct 29, 2026
17 checks passed
@kyasbal
kyasbal deleted the push-ymtypymmvvtl branch October 29, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend-parser Log parsers and log timeline mapper tasks type:bug Something isn't working as expected

1 participant