feat(telemetry): add bounded native pipeline lifecycle
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$ConfigurationTemplate,
|
||||
[string]$PipelineCollector = "$PSScriptRoot\Get-NdcMissionCorePipelineTelemetry.ps1"
|
||||
[string]$PipelineCollector = "$PSScriptRoot\Get-NdcMissionCorePipelineTelemetry.ps1",
|
||||
[string]$PipelineJournal = "D:\NDC_MISSIONCORE\runtime\derived\.perception-persistent-publish\pipeline-telemetry.jsonl"
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -24,6 +25,28 @@ if (-not (Test-Path -LiteralPath $ConfigurationTemplate -PathType Leaf)) {
|
||||
if (-not (Test-Path -LiteralPath $PipelineCollector -PathType Leaf)) {
|
||||
throw "Pipeline collector not found: $PipelineCollector"
|
||||
}
|
||||
$journalParent = Get-Item -LiteralPath (
|
||||
Resolve-Path -LiteralPath (Split-Path $PipelineJournal -Parent)
|
||||
).Path -Force
|
||||
if (
|
||||
-not $journalParent.PSIsContainer -or
|
||||
($journalParent.Attributes -band [IO.FileAttributes]::ReparsePoint) -or
|
||||
[IO.Path]::GetPathRoot($journalParent.FullName).TrimEnd("\") -ine "D:"
|
||||
) {
|
||||
throw "Pipeline journal parent must be a real D: directory"
|
||||
}
|
||||
if (Test-Path -LiteralPath $PipelineJournal) {
|
||||
$journal = Get-Item -LiteralPath $PipelineJournal -Force
|
||||
if (
|
||||
$journal.PSIsContainer -or
|
||||
($journal.Attributes -band [IO.FileAttributes]::ReparsePoint)
|
||||
) {
|
||||
throw "Pipeline journal must be a regular file"
|
||||
}
|
||||
}
|
||||
else {
|
||||
New-Item -ItemType File -Path $PipelineJournal | Out-Null
|
||||
}
|
||||
|
||||
$serviceEnvironmentBefore = @((Get-ItemProperty -Path $serviceRegistryPath).Environment)
|
||||
foreach ($entry in $serviceEnvironmentBefore) {
|
||||
@@ -116,6 +139,7 @@ try {
|
||||
Backup = $backupPath
|
||||
PipelineCollector = $collectorPath
|
||||
PipelineCollectorBackup = if ($hadCollector) { $backupCollectorPath } else { $null }
|
||||
PipelineJournal = $PipelineJournal
|
||||
} | ConvertTo-Json -Compress
|
||||
}
|
||||
catch {
|
||||
|
||||
Reference in New Issue
Block a user