Telemetry.psm1
Source file factory2/lib/Telemetry.psm1. This page is generated from the file’s own help comment when the site is built.
Help text
Section titled “Help text”Events for one factory run, as JSON Lines, always at debug level.
Each process writes its own file, <run dir>\events\<component>.<pid>.jsonl, so no two processes ever share a file (an elevated and anordinary process may not agree on how to share one, and a partial line from one would spoil another). A reader merges the files bytime. Every line carries the run id and OpenTelemetry-style trace, span and parent ids, so a run can be read as one trace later.
A child process finds the run from environment variables it inherits: FACTORY_RUN_DIR, FACTORY_RUN_ID, FACTORY_TRACE_ID, FACTORY_PARENT_SPANThe first event a process writes mints its own span id, and sets FACTORY_PARENT_SPAN to it for the processes it starts next.Elevated processes started with -Verb RunAs may not inherit the environment, so scripts that start one also pass the run on thecommand line (see Get-TelemetryArguments) and call Restore-Telemetry.
Large output never goes in an event. It goes to a file under <run dir>\artifacts\ and the event names the path.Writing an event never changes a run: a failure here is reported once on stderr and then ignored.Functions
Section titled “Functions”New-HexIdGet-RunDirInitialize-TelemetryRestore-TelemetryGet-TelemetryArgumentsGet-WriterWrite-EventNew-ArtifactPath