Skip to content
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

x/telemetry/internal/counter: ErrDisabled references non-existent GOTELEMETRY environment variable #65503

Closed
rittneje opened this issue Feb 3, 2024 · 2 comments
Assignees
Labels
FrozenDueToAge telemetry x/telemetry issues
Milestone

Comments

@rittneje
Copy link
Contributor

rittneje commented Feb 3, 2024

Go version

n/a

Output of go env in your module/workspace:

n/a

What did you do?

I read the source code of x/telemetry.

https://github.com/golang/telemetry/blob/0391c11e4dcd12fa196c5be1a861988de5b6395c/internal/counter/file.go#L114-L115

What did you see happen?

I expected the error message to be accurate. It currently implies that you can disable telemetry by setting GOTELEMETRY=off.

What did you expect to see?

This error message is incorrect. There is no GOTELEMETRY environment variable. The only way to disable telemetry is to explicitly install golang.org/x/telemetry/cmd/gotelemetry and run gotelemetry off, or equivalently create a file under ${os.UserConfigDir()}/go/telemetry/mode that says "off".

https://github.com/golang/telemetry/blob/0391c11e4dcd12fa196c5be1a861988de5b6395c/internal/telemetry/mode.go#L85-L91

@gopherbot gopherbot added the telemetry x/telemetry issues label Feb 3, 2024
@gopherbot gopherbot added this to the Unreleased milestone Feb 3, 2024
@findleyr
Copy link
Member

findleyr commented Feb 3, 2024

Thanks for pointing this out. I'll fix.

That comment is a relic of earlier design. However, we've discussed revisiting support for GOTELEMETRY=off if it would be useful in certain environments. It would be OK to support GOTELEMETRY=off -- we just won't support GOTELEMETRY=on, since we want users to explicitly opt in and see the information printed by golang.org/x/telemetry/cmd/gotelemetry (or by the IDE dialog).

@findleyr findleyr self-assigned this Feb 3, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/561055 mentions this issue: internal/counter: fix error string when telemetry is off

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge telemetry x/telemetry issues
Projects
None yet
Development

No branches or pull requests

3 participants