Repository navigation
Make telemetry default configurable through go.env - #2566
Merged
Merged
Conversation
Resolve the Microsoft telemetry setting through Go's standard configuration hierarchy so distributions can change the installation default without patching telemetry code. Keep Microsoft builds default-on while allowing Azure Linux to set the GOROOT go.env default to off and enable it in selected 1P images. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The test harness inherits CI’s telemetry opt-out and the new test hard-codes a downstream-configurable default.
2 open findings
What changed in this PR
Makes Microsoft Go telemetry configurable through standard go.env precedence.
Changes:
- Adds the installation-wide telemetry default and
go envintegration. - Documents configuration precedence.
- Adds override/restoration tests.
Patch consistency: Patches are happy!
| File | Description |
|---|---|
patches/0007-Add-appinsights-telemetry.patch |
Adds configuration, command integration, documentation, and tests. |
eng/doc/Telemetry.md |
Documents telemetry configuration and precedence. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Keep script telemetry enabled for the fake endpoint even when CI opts out globally, and make the go env test independent of the installation default. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Point users from the installed go.env default to the detailed telemetry documentation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Place the telemetry setting before MS_GO_NOSYSTEMCRYPTO in environment and help lists. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
George Adams (gdams)
enabled auto-merge
October 12, 2026 13:58
Davis Goodin (dagood)
requested changes
Oct 12, 2026
Use the Microsoft build of Go product name consistently, preserve the documentation's newline style, and explain the enabled and disabled values at the start of the opt-out section. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Davis Goodin (dagood)
requested changes
Oct 12, 2026
Use platform-neutral process override guidance, clarify the Microsoft-specific scope, and format the enabled and disabled behavior as separate sentences. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Davis Goodin (dagood)
approved these changes
Oct 12, 2026
Member
Author
|
Copilot backport these changes to the 1.27 and 1.26 release branches. |
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
MS_GOTOOLCHAIN_TELEMETRY_ENABLED=1in the installation-wideGOROOT/go.envcmd/go/internal/cfgso process environment and userGOENVvalues override the installation defaultgo envand document it ingo help environmentRationale
Microsoft Go telemetry remains enabled by default. Azure Linux disables it because its general-purpose images run third-party workloads, and currently carries a downstream code-and-test patch to make telemetry opt-in:
https://github.com/microsoft/azurelinux/blob/4.0/specs/g/golang/0007-Disable-msft-go-telemetry-by-default.patch
Using Go's existing installation configuration lets Azure Linux express that policy by changing one line in
GOROOT/go.env:MS_GOTOOLCHAIN_TELEMETRY_ENABLED=0Selected 1P image builds can restore the value to
1during image construction without rebuilding Go. Explicit process environment and per-userGOENVsettings retain higher precedence, so users and workloads can still override the image default.Resolving the value in
cmd/goand passing a boolean to the shared telemetry counter package avoids introducing a dependency fromcmd/internal/telemetrytocmd/go/internal/cfg.Validation
go test cmd/go -run '^TestScript$/^env_write$' -count=1go test cmd/internal/telemetry/counter -count=1go test -tags=cmd_go_bootstrap cmd/internal/telemetry/counter -count=1git go-patch extractsuccessfully reapplied the full patch stack in its temporary validation clone