Skip to content

Commit

Permalink
refactor(k8s): add more trace logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Apr 12, 2022
1 parent 5d26b47 commit 4103334
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions runtime/kubernetes/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions runtime/kubernetes/pod_tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
}
Expand Down

0 comments on commit 4103334

Please sign in to comment.