Skip to content

Add appinsights telemetry #1684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 6, 2025
Merged

Add appinsights telemetry #1684

merged 8 commits into from
Jun 6, 2025

Conversation

qmuntal
Copy link
Member

@qmuntal qmuntal commented May 29, 2025

This PR makes all go executions upload telemetry data to Azure Application Insights as an opt-in feature which requires manually setting an instrumentation key. Therefore is safe to merge into main until we pass the privacy review.

Set this env variable to enable telemetry on your computed:

MS_GOTOOLCHAIN_TELEMETRY_INSTRUMENTATION_KEY=x # here you need a real instrumentation key!
MS_GOTOOLCHAIN_TELEMETRY_ALLOW_GO_DEVEL=1
MS_GOTOOLCHAIN_TELEMETRY_STATS=1 # optional, but this way you can see how much the telemetry data takes to upload

MS_GOTOOLCHAIN_TELEMETRY_INSTRUMENTATION_KEY will be removed once we have the final instrumentation key, which will be hardcoded.
MS_GOTOOLCHAIN_TELEMETRY_ALLOW_GO_DEVEL will probably stay, but won't be necessary for users outside our team.

I've done some local benchmarking, and the telemetry upload takes ~300ms, which is a reasonable amount of time.

Closes #1672.

Note for reviewers: you don't really need to review most of the new lines. Skip those under src/cmd/vendor, as they are github.com/microsoft/go-infra/telemetry being vendored.

@qmuntal qmuntal requested a review from a team as a code owner May 29, 2025 13:16
@qmuntal qmuntal mentioned this pull request May 29, 2025
@qmuntal qmuntal force-pushed the dev/qmuntal/telemetry branch from f9aa8b2 to 5bc229e Compare June 5, 2025 07:30
@qmuntal qmuntal requested a review from dagood June 5, 2025 07:43
@qmuntal qmuntal merged commit 476a12f into microsoft/main Jun 6, 2025
32 checks passed
@qmuntal qmuntal deleted the dev/qmuntal/telemetry branch June 6, 2025 18:59
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 to the Go toolchain
3 participants