Skip to content

Add per-action correlation ID to log events for concurrent flow tracing#2577

Merged
nagilson merged 5 commits intomainfrom
copilot/add-sha-guid-to-logs
Feb 25, 2026
Merged

Add per-action correlation ID to log events for concurrent flow tracing#2577
nagilson merged 5 commits intomainfrom
copilot/add-sha-guid-to-logs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 20, 2026

Concurrent acquisition flows emit interleaved log events with no way to associate which entries belong to the same operation. This adds an actionId (UUID) to each event so log lines from the same action flow can be correlated.

Core changes

  • IEvent — New public actionId: string = '' field on the base class
  • EventStreamTaggingDecorator (new) — IEventStream wrapper that stamps every posted event with a fixed actionId, defaulting to crypto.randomUUID() per instance
  • LoggingObserver — Emits [actionId] inline when set:
    2/20/2026, 11:58:26 AM 980 [a1b2c3d4-e5f6-...] DotnetAcquisitionStarted
    2/20/2026, 11:58:26 AM 981 [f9e8d7c6-b5a4-...] DotnetAcquisitionStarted   ← concurrent, different ID
    2/20/2026, 11:58:27 AM 120 [a1b2c3d4-e5f6-...] DotnetAcquisitionCompleted ← same flow as first
    
  • Both extensionsgetAcquisitionWorkerContext / getContext now wrap the shared globalEventStream with a fresh EventStreamTaggingDecorator per command invocation, scoping all events (including InstallationValidator) to the same ID
  • index.tsEventStreamTaggingDecorator exported from the library
Original prompt

This section details on the original issue you should resolve

<issue_title>.NET Install Tool Log should have 'sha' or 'guids' for shared Core Command Events</issue_title>
<issue_description>Our logs log these events and handle concurrent calls. We should generate a random guid/sha for each 'set of action flows' to make the log more readable, as it will currently show concurrent actions out of order (fair and ok, because they should be concurrent.)

e.g.
2/20/2026, 11:58:26 AM 980 DotnetRuntimeAcquisitionStarted
2/20/2026, 11:58:26 AM 999 DotnetRuntimeAcquisitionStarted
2/20/2026, 11:58:27 AM 100 DotnetRuntimeAcquisitionTotalSuccessEvent

^ I can now tell from the log which one 'succeeded' regardless of the order of which one finishes first.
Please try to avoid creating a bunch of extra parameters which get passed around from function to function.

Here are some of the groups which should have a shared 'sha' prefix outcome in the log:

DotnetGlobalSDKAcquisitionError, DotnetGlobalSDKAcquisitionTotalSuccessEvent, DotnetGlobalSDKAcquisitionStarted

DotnetRuntimeFinalAcquisitionError, DotnetRuntimeAcquisitionStarted, DotnetRuntimeAcquisitionTotalSuccessEvent DotnetASPNetRuntimeFinalAcquisitionError,
DotnetASPNetRuntimeAcquisitionStarted, DotnetASPNetRuntimeAcquisitionTotalSuccessEvent

DotnetUninstallAllStarted, DotnetUninstallAllCompleted

DotnetExistingPathResolutionCompleted ^ connected for others to use their sha depending on the caller

DotnetFindPathCommandInvoked, DotnetFindPathLookupSetting, DotnetFindPathSettingFound, DotnetFindPathLookupPATH, DotnetFindPathPATHFound, DotnetFindPathLookupRealPATH, DotnetFindPathRealPATHFound, DotnetConditionsValidated, DotnetFindPathHostFxrResolutionLookup , DotnetFindPathOnRegistry, DotnetFindPathNoHostOnRegistry, DotnetFindPathOnFileSystem, DotnetFindPathRootEmulationPATHFound, etc ... to DotnetFindPathNoPathMetCondition, DotnetFindPathDidNotMeetConditionDotnetFindPathMetCondition

DotnetVersionResolutionCompleted ^ for others</issue_description>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…acing

Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com>
Copilot AI changed the title [WIP] Add SHA or GUID for shared Core Command Events in logs Add per-command correlation ID to log events for concurrent flow tracing Feb 20, 2026
Copilot AI requested a review from nagilson February 20, 2026 20:23
Comment thread vscode-dotnet-sdk-extension/src/extension.ts
Comment thread vscode-dotnet-runtime-extension/src/extension.ts
Comment thread vscode-dotnet-runtime-library/src/EventStream/IEvent.ts Outdated
…LoggingObserver, and tests

Co-authored-by: nagilson <23152278+nagilson@users.noreply.github.com>
Copilot AI changed the title Add per-command correlation ID to log events for concurrent flow tracing Add per-action correlation ID to log events for concurrent flow tracing Feb 20, 2026
Copilot AI requested a review from nagilson February 20, 2026 23:33
@nagilson nagilson marked this pull request as ready for review February 25, 2026 18:27
@nagilson nagilson requested a review from a team February 25, 2026 18:27
@nagilson nagilson merged commit dc25718 into main Feb 25, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.NET Install Tool Log should have 'sha' or 'guids' for shared Core Command Events

3 participants