Skip to content

fix(must-gather): restore per-line timestamps on collected pod logs - #3564

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
Clee2691:LOG-10434
Nov 12, 2026
Merged

openshift-merge-bot[bot] merged 1 commit into
openshift:masterfrom
Clee2691:LOG-10434

Conversation

@Clee2691

@Clee2691 Clee2691 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR restores the per-line timestamps on collected pod logs for must-gather

/cc @vparfonov
/assign @jcantrill

Links

Summary by CodeRabbit

  • New Features
    • Collected container logs now include an RFC3339-formatted timestamp at the start of each line, making it easier to identify when log events occurred. This timestamp is included in the logs gathered for troubleshooting and review.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between cdf7005 and 93a9922.

Files selected for processing: 1
  • must-gather/internal/namespace/collector.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

Walkthrough

The namespace collector now requests RFC3339 timestamps in container log output.

Changes: Container log timestamp collection

Layer / File(s) Summary
Enable log timestamps
must-gather/internal/namespace/collector.go
collectContainerLog sets PodLogOptions.Timestamps to true when requesting container logs.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Merge Risk: Minimal · up to 93a99

The requested timestamp restoration is narrowly scoped with no identified merge-blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description check Passed The description states the intent, includes a reviewer, includes an approver, and links the related JIRA issue. It is brief but sufficiently complete for this focused change.
Title check Passed The title clearly and concisely describes the main change: restoring per-line timestamps on collected pod logs.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@qodo-for-rh-openshift

Copy link
Copy Markdown

PR Summary by Qodo

Restore per-line timestamps in must-gather pod logs

🐞 Bug fix 🕐 Less than 5 minutes


AI Description

• Request timestamps from Kubernetes when collecting pod logs, restoring per-line prefixes.
• Apply the request to current and previous logs for regular and init containers.
Diagram

sequenceDiagram
    participant Collector as Namespace collector
    participant KubeAPI as Kubernetes pod logs
    participant LogFile as Gathered log file
    Collector->>KubeAPI: GetLogs with timestamps
    KubeAPI-->>Collector: Timestamped log stream
    Collector->>LogFile: Copy stream
Loading
High-Level Assessment

Requesting timestamps through PodLogOptions is the direct fix: Kubernetes supplies the prefixes, and the existing streaming path writes them unchanged. Adding timestamps locally would duplicate that behavior.

Files changed (1) +3 / -0

Bug fix (1) +3 / -0
collector.goRequest timestamps for collected container logs +3/-0

Request timestamps for collected container logs

• Sets PodLogOptions.Timestamps to true in the shared container-log collection path. Current and previous logs from regular and init containers therefore receive Kubernetes-provided per-line timestamp prefixes.

must-gather/internal/namespace/collector.go

@qodo-for-rh-openshift

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Powered by Qodo

@jcantrill

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@jcantrill

Copy link
Copy Markdown
Contributor

/cherrypick release-6.7
/cherrypick release-6.6
/cherrypick release-6.2
/cherrypick release-6.0

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jcantrill: once the present PR merges, I will cherry-pick it on top of release-6.0, release-6.2, release-6.6, release-6.7 in new PRs and assign them to you.

Details

In response to this:

/cherrypick release-6.7
/cherrypick release-6.6
/cherrypick release-6.2
/cherrypick release-6.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Nov 2, 2026
@openshift-ci

openshift-ci Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Clee2691, jcantrill

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 2, 2026
@Clee2691

Clee2691 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/retest

2 similar comments
@Clee2691

Clee2691 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@Clee2691

Copy link
Copy Markdown
Contributor Author

/retest

@jcantrill

Copy link
Copy Markdown
Contributor

/cherry-pick release-6.5

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jcantrill: once the present PR merges, I will cherry-pick it on top of release-6.5 in a new PR and assign it to you.

Details

In response to this:

/cherry-pick release-6.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jcantrill

Copy link
Copy Markdown
Contributor

/cherrypick release-6.5

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jcantrill: once the present PR merges, I will cherry-pick it on top of release-6.5 in a new PR and assign it to you.

Details

In response to this:

/cherrypick release-6.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@jcantrill

Copy link
Copy Markdown
Contributor

/label verified

@openshift-ci openshift-ci Bot added the verified Signifies that the PR passed pre-merge verification criteria label Nov 11, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD bcce830 and 2 for PR HEAD 93a9922 in total

@openshift-ci

openshift-ci Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

@Clee2691: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-pre-merge 93a9922 link false /test e2e-pre-merge

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot
openshift-merge-bot Bot merged commit 285263c into openshift:master Nov 12, 2026
9 of 10 checks passed
@openshift-cherrypick-robot

Copy link
Copy Markdown

@jcantrill: new pull request created: #3575

Details

In response to this:

/cherrypick release-6.7
/cherrypick release-6.6
/cherrypick release-6.2
/cherrypick release-6.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jcantrill: new pull request created: #3576

Details

In response to this:

/cherrypick release-6.7
/cherrypick release-6.6
/cherrypick release-6.2
/cherrypick release-6.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jcantrill: new pull request created: #3577

Details

In response to this:

/cherrypick release-6.7
/cherrypick release-6.6
/cherrypick release-6.2
/cherrypick release-6.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jcantrill: new pull request created: #3578

Details

In response to this:

/cherrypick release-6.7
/cherrypick release-6.6
/cherrypick release-6.2
/cherrypick release-6.0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-cherrypick-robot

Copy link
Copy Markdown

@jcantrill: new pull request created: #3579

Details

In response to this:

/cherrypick release-6.5

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release/6.8 verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants