Skip to content

feat: log collector updates#8218

Merged
timmy-wright merged 2 commits intomainfrom
timmy/windows-log-collector-updates
Apr 2, 2026
Merged

feat: log collector updates#8218
timmy-wright merged 2 commits intomainfrom
timmy/windows-log-collector-updates

Conversation

@timmy-wright
Copy link
Copy Markdown
Contributor

  • Add the aks-windows-exporter logs to the list of files that might be locked
  • Add an e2e test to check the log collection script can be run

What this PR does / why we need it:

Because the log collection script was failing.

Which issue(s) this PR fixes:

Fixes #

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Windows log collection/cleanup to account for aks-windows-exporter logs and adds Windows e2e coverage to ensure the collect-windows-logs.ps1 script can be executed and produces a zip bundle.

Changes:

  • Include aks-windows-exporter log files in Windows log cleanup generation and “locked file” handling.
  • Add e2e validator + scenarios for Windows Server 2022/2025 to run c:\k\debug\collect-windows-logs.ps1 and verify a zip is produced.
  • Remove the legacy/stub vhdbuilder/scripts/windows/collect-windows-logs.ps1 reference file (moved to staging/...).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vhdbuilder/scripts/windows/collect-windows-logs.ps1 Removes the old stub note pointing to the staging script location.
staging/cse/windows/provisioningscripts/windowslogscleanup.ps1 Adds aks-windows-exporter prefixes to cleanup rotation logic.
staging/cse/windows/provisioningscripts/loggenerator.ps1 Adds aks-windows-exporter log filenames to generated log set.
staging/cse/windows/debug/collect-windows-logs.ps1 Adds aks-windows-exporter logs to the locked-files list used during collection.
e2e/validators.go Adds a validator that runs the Windows log collection script and checks for a produced zip.
e2e/scenario_win_test.go Adds Windows 2022 and Windows 2025 scenarios that invoke the new validator.

Copilot AI review requested due to automatic review settings April 1, 2026 02:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

staging/cse/windows/provisioningscripts/windowslogscleanup.ps1:20

  • windowslogscleanup.ps1 is executed via powershell.exe (Windows PowerShell 5.1) by the scheduled task registration. Select-Object -SkipLast is not supported in Windows PowerShell 5.1, so this line will throw and prevent log cleanup from running. Consider replacing it with PS 5.1-compatible logic to keep the newest 5 logs (e.g., compute Count-5 and Select-Object -First).
$logFilePrefixes = @("kubelet", "kubelet.err", "kubeproxy", "kubeproxy.err", "containerd.err", "containerd", "windows-exporter.err", "windows-exporter","aks-windows-exporter.err", "aks-windows-exporter")

foreach ($logFilePrefix in $logFilePrefixes) {
    $oldLogs = [IO.Directory]::GetFiles("c:\k", "$($logFilePrefix)-*.log")
    $oldLogs = $oldLogs | Sort-Object | Select-Object -SkipLast 5

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Copilot AI review requested due to automatic review settings April 2, 2026 02:35
@timmy-wright timmy-wright force-pushed the timmy/windows-log-collector-updates branch from 6b4e3da to 1ab6d88 Compare April 2, 2026 02:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

@timmy-wright timmy-wright merged commit 3215165 into main Apr 2, 2026
34 of 35 checks passed
@timmy-wright timmy-wright deleted the timmy/windows-log-collector-updates branch April 2, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

VHD your change will be included in the following VHDs windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants