Skip to content

Add combined logs for multi-pod workloads - #2418

Open
krishantt wants to merge 1 commit into
freelensapp:mainfrom
krishantt:combined-pod-logs
Open

Add combined logs for multi-pod workloads#2418
krishantt wants to merge 1 commit into
freelensapp:mainfrom
krishantt:combined-pod-logs

Conversation

@krishantt

@krishantt krishantt commented Aug 15, 2026

Copy link
Copy Markdown

Fixes #687.

Adds a "Logs" action to the workload context menu for Deployments,
DaemonSets, StatefulSets, ReplicaSets, and Jobs that opens a single
dock tab merging the logs of every child pod. Lines from all pods are
interleaved chronologically (by the leading RFC3339 timestamp the
Kubernetes API attaches to each line) and tagged with a per-pod color
so it's easy to tell which pod a given line came from at a glance, per
@MatiasRoje's suggestion on #687 ("Probably in different colors
depending on the pod"). Single-pod log tabs are unchanged.

This covers the same need as the now-unmaintained
freelens-multi-pod-logs
extension referenced in #687, brought into core per the option
@robertobandini and @MatiasRoje favored in that thread. It doesn't
touch the separate, larger logs-rendering rework (virtual list -> xterm,
selection-during-scroll) raised in #1170 and referenced from #687 --
that's scoped as its own follow-up.

  • merge-pod-logs.ts: k-way merge across each pod's log lines, with a
    deterministic per-pod ANSI color assigned by hashing the pod name.
    The whole tagged line (pod-name tag and message) is colored, not
    just the tag, so lines stay legible whether or not "Show timestamps"
    is on.
  • store.ts: fetches each pod's logs in parallel (Promise.allSettled)
    and only blanks the tab if every pod's fetch fails, so one pod being
    briefly unreachable doesn't wipe out logs still streaming from the
    rest of a combined tab.
  • resource-selector.tsx: combined tabs show a "N pods" badge (with a
    tooltip listing pod names) instead of the single-pod switcher.
  • logs-view-model.ts / download-all-logs-for-pods.injectable.ts:
    downloading a combined tab's logs is named after the owning
    workload rather than any single pod.

Manually verified against a 3-replica Deployment on a local cluster,
including with "Show timestamps" toggled on.

| Model: claude-sonnet-5

Adds a "Logs" action to the workload context menu for Deployments,
DaemonSets, StatefulSets, ReplicaSets, and Jobs that opens a single
dock tab merging the logs of every child pod, chronologically
interleaved and tagged with a per-pod color so lines from different
pods are distinguishable at a glance. Single-pod tabs are unaffected.

Coloring covers the full log line (tag and message), not just the
pod-name tag, so it stays legible whether or not "Show timestamps" is
on.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add support for deployment / stateful set logs

1 participant