Add msgo/module and msgo/ci telemetry counters#2283
Open
gdams wants to merge 4 commits into
Open
Conversation
157fe41 to
b3ed91d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds three Microsoft-specific telemetry counters (msgo/module, msgo/ci, msgo/systemcrypto) to the Microsoft build of Go, and vendors the updated go-infra/telemetry dependency providing the new DetectCI function.
Changes:
- Add three new counters in
incrementConfig()withmsgo/modulegated behindMS_GO_INTERNAL_CUSTOMERenv var. - Vendor updated
github.com/microsoft/go-infra/telemetrywith newci.go(DetectCI). - Update
config.jsonto register the new counter names.
Show a summary per file
| File | Description |
|---|---|
| patches/0009-Add-appinsights-telemetry.patch | Adds the three new counters to telemetrystats.go with required imports. |
| patches/0001-Vendor-external-dependencies.patch | Vendors new ci.go, bumps dependency version, updates config.json. |
| go | Bumps the go submodule commit. |
Copilot's findings
Comments suppressed due to low confidence (4)
patches/0001-Vendor-external-dependencies.patch:1
- Typo in counter name:
mssgo/systemcryptoshould bemsgo/systemcryptoto match the actual counter incremented intelemetrystats.go. As-is, the counter emitted by the code will not match any registered name inconfig.json.
patches/0001-Vendor-external-dependencies.patch:1 - The Jenkins detection (
BUILD_ID+BUILD_URL) is checked before Google Cloud Build, butBUILD_IDis also set by Google Cloud Build. More importantly, the Google Cloud Build check is unreachable if Jenkins'sBUILD_URLhappens to be set, and conversely many GCB builds wherePROJECT_IDis exported alongside an environment that hasBUILD_URLcould be misattributed. Consider checking GCB-unique variables (e.g.BUILDER_OUTPUT) and reordering / using more specific markers for each system to reduce false positives.
patches/0001-Vendor-external-dependencies.patch:1 - The PR description mentions the counter as
msgo/ci, but no entry formsgo/module:*review is needed since it requires module path values. Verify thatmsgo/module:*is acceptable inconfig.jsonschema (free-form wildcard counter) — if the upload schema requires enumerated values,*may not be honored.
patches/0001-Vendor-external-dependencies.patch:1 AWS_REGIONis commonly set in many AWS environments (not just CodeBuild).CODEBUILD_BUILD_IDalone is sufficient and CodeBuild-specific; the extraAWS_REGIONrequirement risks false negatives where a CodeBuild runner doesn't exportAWS_REGION. Consider dropping theAWS_REGIONcheck.
- Files reviewed: 2/2 changed files
- Comments generated: 3
Add three new Microsoft-specific telemetry counters: - msgo/module: Reports the Go module path of the project being built. This counter is only collected when the MS_GO_INTERNAL_CUSTOMER environment variable is set, restricting it to first-party (1P) Microsoft customers who have explicitly opted in. - msgo/ci: Detects and reports the CI system in use (e.g. azdo, github, gitlab) using the go-infra telemetry.DetectCI function, which inspects environment variables to identify the CI platform. - msgo/systemcrypto: Reports whether system crypto (e.g. OpenSSL, CNG) is enabled or disabled on platforms that support it. Also vendors the updated go-infra/telemetry dependency which includes the new DetectCI function (ci.go) and updated config.json.
b3ed91d to
ee50eec
Compare
qmuntal
requested changes
May 18, 2026
qmuntal
approved these changes
May 18, 2026
dagood
requested changes
May 18, 2026
Member
There was a problem hiding this comment.
Discussion in https://github.com/microsoft/go-lab/issues/382
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
Add two new Microsoft-specific telemetry counters to
incrementConfig()intelemetrystats.go, and vendor the updatedgo-infra/telemetrydependency (which includes the newDetectCIfunction).fixes: https://github.com/microsoft/go-lab/issues/382
New counters
msgo/module:<module_path>Reports the Go module path (from
go.mod) of the project being built.This counter is gated behind the
MS_GO_INTERNAL_CUSTOMERenvironment variable and is only collected for first-party (1P) Microsoft customers who have explicitly opted in. It is not collected for general users of the Microsoft build of Go.msgo/ci:<system>Detects the CI system in use by inspecting environment variables via
telemetry.DetectCI(os.Environ()). Reports values likeazdo,github,gitlab,appveyor, etc. Only incremented when a CI system is detected.Dependency changes
github.com/microsoft/go-infra/telemetryto include the newci.gofile (DetectCIfunction) and updatedconfig.json.Patch changes
ci.goto vendor.