fix: watch pods instead of rs by Flo4604 · Pull Request #5328 · unkeyed/unkey
83-83: Consider Debug log level for routine events.
Info level for every pod event may be noisy in production clusters with frequent pod churn. Lines 87, 94, 110, 112 also use Info.
♻️ Suggested change
- logger.Info("pod watch: event received", "pod", pod.Name, "namespace", pod.Namespace, "type", event.Type, "phase", pod.Status.Phase, "ip", pod.Status.PodIP) + logger.Debug("pod watch: event received", "pod", pod.Name, "namespace", pod.Namespace, "type", event.Type, "phase", pod.Status.Phase, "ip", pod.Status.PodIP)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@svc/krane/internal/deployment/pod_watch.go` at line 83, The pod watch handler
currently logs every pod event at Info level (see logger.Info call that logs
"pod watch: event received" and the other Info calls at the same block); change
these routine event logs to logger.Debug to reduce noise in production, keeping
Info only for errors or important state transitions; update the specific
logger.Info occurrences referenced (the "pod watch: event received" call and the
other Info calls on the same flow at lines corresponding to the subsequent event
handling) to use logger.Debug (or a conditional Info when phase changes to a
notable state) so routine pod churn is logged at debug level while preserving
important Info-level messages.