Skip to content

Add multithreaded mode information to build telemetry#12508

Merged
baronfel merged 1 commit into
dotnet:mainfrom
AR-May:add-mt-basic-telemetry
Sep 11, 2025
Merged

Add multithreaded mode information to build telemetry#12508
baronfel merged 1 commit into
dotnet:mainfrom
AR-May:add-mt-basic-telemetry

Conversation

@AR-May

@AR-May AR-May commented Sep 10, 2025

Copy link
Copy Markdown
Member

Partially fixes #12507

Adding basic telemetry for multithreaded MSBuild:

  • emit information whether the multithreading is enabled or not.

Copilot AI review requested due to automatic review settings September 10, 2025 09:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds telemetry tracking for multithreaded mode in MSBuild builds. The change allows MSBuild to report whether multithreaded mode was enabled during a build, providing valuable data for understanding build configurations and performance patterns.

  • Adds a new MultiThreadedModeEnabled property to the BuildTelemetry class
  • Updates the BuildManager to capture the multithreaded mode state from build parameters
  • Includes comprehensive test coverage for the new telemetry property

Reviewed Changes

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

File Description
src/Framework/Telemetry/BuildTelemetry.cs Adds MultiThreadedModeEnabled property and integrates it into telemetry collection methods
src/Build/BackEnd/BuildManager/BuildManager.cs Sets the multithreaded mode telemetry value from build parameters
src/Build.UnitTests/BackEnd/KnownTelemetry_Tests.cs Updates tests to verify the new telemetry property behavior

@JanProvaznik JanProvaznik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@AR-May

AR-May commented Sep 10, 2025

Copy link
Copy Markdown
Member Author

https://github.com/dotnet/sdk/blob/main/src/Cli/dotnet/Commands/MSBuild/MSBuildLogger.cs
needs update to send it to sdk telemetry backend

Do we need any update in SDK when we add properties to the existing event? I see that fields that needs some processing like hashing need some changes, but this one probably does not need. I will though need it for the next PR with task factories stats, so thanks for mentioning this.

@JanProvaznik

Copy link
Copy Markdown
Member

you're probably right that this gets picked up without changes

@JanProvaznik

Copy link
Copy Markdown
Member

ah I now remembered, pls update https://github.com/dotnet/msbuild/blob/c9e83a9059f5bf140678d2dd3735b1d5001a45df/documentation/wiki/CollectedTelemetry.md when you have the events figured out @AR-May

@baronfel

Copy link
Copy Markdown
Member

We'll need to update SDK's GDPR classification for the new property on the existing event, yes - but that happens in the GDPR classification tool, not in the SDK repo. When we get the TaskFactory-level data, depending on how/where that data is sent through telemetry we might need to allowlist the new event in the SDK repo.

@baronfel baronfel merged commit 06ee62d into dotnet:main Sep 11, 2025
9 checks passed
baronfel added a commit that referenced this pull request Sep 22, 2025
Just a quick change to sync this now that
#12508 is merged.

---------

Co-authored-by: Copilot <[email protected]>
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.

Add telemetry for single process multithreaded MSBuild

5 participants