From 4103334720eb8491bdb10686e78fdf9e0432f1c5 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Mon, 11 Apr 2022 20:03:28 -0500 Subject: [PATCH] refactor(k8s): add more trace logs --- runtime/kubernetes/container.go | 1 + runtime/kubernetes/pod_tracker.go | 1 + 2 files changed, 2 insertions(+) diff --git a/runtime/kubernetes/container.go b/runtime/kubernetes/container.go index 09ee050b..4da8288f 100644 --- a/runtime/kubernetes/container.go +++ b/runtime/kubernetes/container.go @@ -245,6 +245,7 @@ func (c *client) TailContainer(ctx context.Context, ctn *pipeline.Container) (io // streamContainerLogs streams the logs to a cache up to a maxLogSize, restarting the stream as needed. // streamContainerLogs is designed to run in its own goroutine. func (p podTracker) streamContainerLogs(ctx context.Context, ctnTracker *containerTracker, maxLogSize uint) { + p.Logger.Tracef("begin streaming logs for container %s in %s", ctnTracker.Name, p.TrackedPod) // create function for periodically capturing // the logs from the container with backoff logsFunc := func() (bool, error) { diff --git a/runtime/kubernetes/pod_tracker.go b/runtime/kubernetes/pod_tracker.go index e205260a..b3280d49 100644 --- a/runtime/kubernetes/pod_tracker.go +++ b/runtime/kubernetes/pod_tracker.go @@ -165,6 +165,7 @@ func (p podTracker) Start(ctx context.Context, maxLogSize uint) { // TrackContainers creates a containerTracker for each container. func (p *podTracker) TrackContainers(containers []v1.Container) { + p.Logger.Tracef("adding %d containerTrackers for pod %s", len(containers), p.TrackedPod) if p.Containers == nil { p.Containers = map[string]*containerTracker{} }