Skip to content

Add release telemetry canary gate - #14727

Merged
JanProvaznik merged 4 commits into
mainfrom
alesprokop/telemetry-release-canary
Sep 23, 2026
Merged

JanProvaznik merged 4 commits into
mainfrom
alesprokop/telemetry-release-canary

Conversation

@AlesProkop

@AlesProkop AlesProkop commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

Fixes #14714

Context

Telemetry initialization and disposal are best effort, so a release candidate can complete successfully even when end-to-end telemetry ingestion is broken. This adds a release-promotion gate that executes the produced candidate and verifies a uniquely identifiable event reaches the telemetry backend.

Changes Made

  • Added MSBUILD_TELEMETRY_CANARY_ID support that posts VS/MSBuild/ReleaseCanary through the existing full-framework telemetry session immediately before normal disposal.
  • Added eng/validate-telemetry-canary.ps1 to extract the exact Microsoft.Build.Runtime package, execute its net472 MSBuild.exe, and poll a configured Azure Data Explorer function for the canary.
  • Added the Release Telemetry Canary stage for vs* official builds and made Arcade post-build publication depend on it.
  • Added a compile-time, manual-only allowTelemetryCanaryFailure override that removes the backend-dependent tasks from an overridden run.
  • Added focused PowerShell tests for four-component MSBuild versions, Kusto count parsing, polling success/timeout, and the pipeline override structure.
  • Updated documentation/release-checklist.md to require a successful canary for the official build selected for release.

Testing

  • Built the repository with build.cmd -v quiet: 0 warnings, 0 errors.
  • Built src/MSBuild/MSBuild.csproj: 0 warnings, 0 errors.
  • Ran TelemetryManager_Tests through the direct Microsoft.Testing.Platform host: 4 passed, 0 failed, 0 skipped.
  • Ran eng/validate-telemetry-canary.Tests.ps1: passed.
  • Verified missing telemetry configuration fails closed.
  • Parsed .vsts-dotnet.yml, eng/validate-telemetry-canary.ps1, and eng/validate-telemetry-canary.Tests.ps1 successfully.

Notes

  • The official pipeline must configure TelemetryCanaryClusterUri, TelemetryCanaryDatabase, and TelemetryCanaryQueryFunction.
  • The Darc: Maestro Production service connection must have query access to the configured Azure Data Explorer database, or telemetryCanaryAzureServiceConnection must be set to another compile-time-authorized connection.
  • The backend must collect VS/MSBuild/ReleaseCanary at 100% so the gate does not depend on normal telemetry sampling.

AlesProkop and others added 2 commits August 18, 2026 09:12
Co-authored-by: Copilot <[email protected]>
Copilot-Session: a4176169-5c8c-4d93-bdf0-16f1a089978e
Co-authored-by: Copilot <[email protected]>
Copilot-Session: a4176169-5c8c-4d93-bdf0-16f1a089978e
@AlesProkop
AlesProkop marked this pull request as ready for review August 18, 2026 07:31
@AlesProkop
AlesProkop requested a review from a team as a code owner August 18, 2026 07:31
Copilot AI lite review requested due to automatic review settings August 18, 2026 07:31

@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.

this is a good goal, but I don't think the change is complete and I'm doubtful it's achievable this way

The tables where we push telemetry have ~hours delay.

It tests only the VS path while to me the SDK is more interesting and we had also a recent regression due to how server and sdk client communicate.

how do you plan to validate this?
I am against putting it in official build as that introduces new network dependencies that may block it, it could be a stage of the internal CI that runs on main.

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

Adds a release-promotion telemetry “canary” to verify that an official vs* release candidate can emit a uniquely identifiable telemetry event and that it is successfully ingested end-to-end before publishing artifacts.

Changes:

  • Emit a VS/MSBuild/ReleaseCanary event (keyed by MSBUILD_TELEMETRY_CANARY_ID) immediately before telemetry disposal in full-framework MSBuild.
  • Add eng/validate-telemetry-canary.ps1 (+ companion PowerShell tests) to execute the exact Microsoft.Build.Runtime net472 MSBuild and poll Azure Data Explorer for canary ingestion.
  • Add a Release Telemetry Canary pipeline stage for vs* official builds and make post-build validation depend on it, with a manual-only override switch documented in the release checklist.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/MSBuild/XMake.cs Emits the release canary before telemetry disposal at process exit.
src/Framework/Telemetry/TelemetryManager.cs Adds canary env var constant and posting logic for VS telemetry sessions.
src/Framework/Telemetry/TelemetryConstants.cs Defines the ReleaseCanary event name constant.
src/Framework.UnitTests/TelemetryManager_Tests.cs Adds unit test validating canary property shape/identity.
eng/validate-telemetry-canary.ps1 New canary validator: extracts runtime package MSBuild.exe, runs it, and polls ADX.
eng/validate-telemetry-canary.Tests.ps1 New lightweight PowerShell tests for validator helpers and YAML override structure.
.vsts-dotnet.yml Adds the Release Telemetry Canary stage + manual override parameterization and dependency wiring.
documentation/release-checklist.md Requires a successful canary (or documented manual override) for release selection.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread eng/validate-telemetry-canary.ps1 Resolved
Comment thread src/MSBuild/XMake.cs Resolved
@AlesProkop

Copy link
Copy Markdown
Member Author

this is a good goal, but I don't think the change is complete and I'm doubtful it's achievable this way

The tables where we push telemetry have ~hours delay.

It tests only the VS path while to me the SDK is more interesting and we had also a recent regression due to how server and sdk client communicate.

how do you plan to validate this? I am against putting it in official build as that introduces new network dependencies that may block it, it could be a stage of the internal CI that runs on main.

@JanProvaznik You are right, if the telemetry takes hours, this approach is not good.

What if we split this in a way. There would be an internal prerelease pipeline that would run the exact candidate, emit the canary and validate that telemetry was generated? Then, the build promotion task would only query it and block promotion if it is missing.

@rainersigwald

Copy link
Copy Markdown
Member

In my head, we'd have "we have some data from recent canary builds" on the release checklist around canary->insiders promotion time, and likewise "there's some data from the final/insiders build" around GA time. The delay shouldn't matter for that. Does that sound reasonable?

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Skill Validator Results

⚠️ Warnings or advisories found

Scope Checked
Skills 1
Agents 0
Total 1
Severity Count
--- ---:
❌ Errors 0
⚠️ Warnings 1
ℹ️ Advisories 0

Summary

Level Finding
ℹ️ Found 1 skill(s)
ℹ️ [release] 📊 release: 4,590 BPE tokens [chars/4: 4,469] (standard ~), 14 sections, 1 code blocks
ℹ️ [release] ⚠ Skill is 4,590 BPE tokens (chars/4 estimate: 4,469) — approaching "comprehensive" range where gains diminish.
ℹ️ ✅ All checks passed (1 skill(s))
Full validator output ```text Found 1 skill(s) [release] 📊 release: 4,590 BPE tokens [chars/4: 4,469] (standard ~), 14 sections, 1 code blocks [release] ⚠ Skill is 4,590 BPE tokens (chars/4 estimate: 4,469) — approaching "comprehensive" range where gains diminish. ✅ All checks passed (1 skill(s)) ```

Comment thread documentation/release-checklist.md Resolved
@JanProvaznik
JanProvaznik merged commit 59033a9 into main Sep 23, 2026
15 checks passed
@JanProvaznik
JanProvaznik deleted the alesprokop/telemetry-release-canary branch September 23, 2026 11:02
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 release-promotion validation for MSBuild telemetry

4 participants