Skip to content

Add per-task telemetry event (build/tasks/details) end-to-end [VMR review preview] - #1

Closed
jankratochvilcz wants to merge 1 commit into
mainfrom
jan/telemetry-tasks-details
Closed

Add per-task telemetry event (build/tasks/details) end-to-end [VMR review preview]#1
jankratochvilcz wants to merge 1 commit into
mainfrom
jan/telemetry-tasks-details

Conversation

@jankratochvilcz

Copy link
Copy Markdown
Owner

Combines two upstream PRs into a single VMR changeset for easier end-to-end review:

  • MSBuild sidedotnet/msbuild#13609: emit new build/tasks/details event from BuildManager with TaskCount / TotalTaskCount / Tasks (JSON, top 100 by ExecutionsCount). Serialization helper lives in src/Build so it can use System.Text.Json directly (no new package deps on net472/net10). Gated by the existing MSBUILDTELEMETRYEXCLUDETASKSDETAILS env var.
  • SDK sidedotnet/sdk#54092: MSBuildLogger pass-through-forwards the event under the msbuild/ namespace. No client-side aggregation — MSBuild already does the capping/hashing.

Motivation

The CLI/SDK telemetry sink only accepts IDictionary<string, string?>, so per-task data has to be reduced to a JSON string in the engine before it can leave. The VS path already had this via TelemetryComplexProperty. Closes the blind spot for SDK/CLI users so we have real-world frequency data to drive decisions about which built-in tasks to prioritize / optimize.

Files touched

MSBuild (5):

  • src/msbuild/src/Build/BackEnd/BuildManager/BuildManager.cs
  • src/msbuild/src/Build/Microsoft.Build.csproj
  • src/msbuild/src/Build/TelemetryInfra/TasksDetailsTelemetry.cs (new)
  • src/msbuild/src/Framework/Telemetry/TelemetryDataUtils.cs
  • src/msbuild/src/Build.UnitTests/Telemetry/Telemetry_Tests.cs

SDK (2):

  • src/sdk/src/Cli/dotnet/Commands/MSBuild/MSBuildLogger.cs
  • src/sdk/test/dotnet.Tests/CommandTests/MSBuild/GivenMSBuildLogger.cs

Note

This branch is for review convenience only — actual merges go to the individual repos.

Combines two upstream PRs into a single VMR changeset so the MSBuild emit and SDK forward arrive together:

- dotnet/msbuild#13609: emit new 'build/tasks/details' event from BuildManager with TaskCount/TotalTaskCount/Tasks (JSON, top 100 by ExecutionsCount). Serialization helper lives in src/Build (System.Text.Json), gated by MSBUILDTELEMETRYEXCLUDETASKSDETAILS.

- dotnet/sdk#54092: SDK MSBuildLogger pass-through-forwards the event under the 'msbuild/' namespace; payload is already aggregated and hashed in MSBuild, no client-side aggregation.

Motivation: CLI telemetry sink only accepts IDictionary<string,string?>, so per-task data has to be reduced to a JSON string in the engine before it can leave; VS path already had this via TelemetryComplexProperty. This closes the blind spot for SDK/CLI users.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jankratochvilcz

Copy link
Copy Markdown
Owner Author

Retargeting to upstream dotnet/dotnet

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.

1 participant