refactor(platform): harden LAB evidence and telemetry

This commit is contained in:
DCCONSTRUCTIONS
2026-08-05 10:03:37 +03:00
parent 67bd96868f
commit 4c763bd8aa
42 changed files with 936 additions and 272 deletions
@@ -118,8 +118,27 @@ try {
[ServiceProcess.ServiceControllerStatus]::Running,
[TimeSpan]::FromSeconds(20)
)
& sc.exe failure $serviceName reset= 86400 `
actions= restart/5000/restart/30000/restart/60000 | Out-Null
if ($LASTEXITCODE -ne 0) {
throw "Failed to configure Telegraf service recovery actions"
}
& sc.exe failureflag $serviceName 1 | Out-Null
if ($LASTEXITCODE -ne 0) {
throw "Failed to enable Telegraf recovery for non-crash failures"
}
}
catch {
Stop-Service -Name $serviceName -Force -ErrorAction SilentlyContinue
$service = Get-Service -Name $serviceName
if ($service.Status -ne [ServiceProcess.ServiceControllerStatus]::Stopped) {
$service.WaitForStatus(
[ServiceProcess.ServiceControllerStatus]::Stopped,
[TimeSpan]::FromSeconds(20)
)
}
Set-ItemProperty -Path $serviceRegistryPath -Name Environment `
-Type MultiString -Value $serviceEnvironmentBefore
Copy-Item -LiteralPath $backupPath -Destination $configurationPath
if ($hadCollector) {
Copy-Item -LiteralPath $backupCollectorPath -Destination $collectorPath
@@ -135,6 +154,7 @@ try {
SchemaVersion = "missioncore.telemetry-agent-config-result/v1"
ServiceName = $serviceName
Status = (Get-Service -Name $serviceName).Status.ToString()
RecoveryConfigured = $true
Configuration = $configurationPath
Backup = $backupPath
PipelineCollector = $collectorPath