Skip to content

Unknown go command variable GOTELEMETRY - how to disable telemetry? #67424

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

Closed
TLINDEN opened this issue May 16, 2024 · 5 comments
Closed

Unknown go command variable GOTELEMETRY - how to disable telemetry? #67424

TLINDEN opened this issue May 16, 2024 · 5 comments

Comments

@TLINDEN
Copy link

TLINDEN commented May 16, 2024

Go version

go1.22.1

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/foo/.cache/go-build'
GOENV='/home/foo/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/foo/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/foo/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go1.22.1.linux-amd64'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go1.22.1.linux-amd64/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.1'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build24553183=/tmp/go-build -gno-record-gcc-switches'

What did you do?

I've read this issue which links to this telemetry paper, which says, that in order to completely disable telemetry I have to execute go env -w GOTELEMETRY=off.

What did you see happen?

When I do, I get:

go env -w GOTELEMETRY=off
go: unknown go command variable GOTELEMETRY

What did you expect to see?

I'd expect some kind of success message.

As I can see in ~/.config/go/telemetry/ go is already collecting telemetry data, but not uploading it (yet). But I don't trust it and I just want to disable the whole process, because I don't want my compiler to send any telemetry data about my use of it to anyone, however small it might be. From my point of view this is a freaking nightmare!

So, how can I - as of now - shut this down?

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
@TLINDEN
Copy link
Author

TLINDEN commented May 16, 2024

This was not a question, but indeed a bug. The command go env -w GOTELEMETRY=off does not work. So, either the documentation or the code need to be fixed.

So, please re-open this issue. Thanks.

@randall77
Copy link
Contributor

Read the "[Update ...]" notice at the top of the section where you saw the GOTELEMETRY=off command.

@TLINDEN
Copy link
Author

TLINDEN commented May 16, 2024

Ok, I found how to turn it off: https://go.dev/doc/telemetry#config

@a-pav
Copy link

a-pav commented Jun 21, 2024

This snippet turns off telemetry how gotelemetry off command currently does it.

GO_TELEMETRY_DIR="$HOME/.config/go/telemetry";

# Create the directory if it doesn't already exist.
[ ! -d "$GO_TELEMETRY_DIR" ] && mkdir -m 0755 "$GO_TELEMETRY_DIR";

echo "off $(date +%Y-%m-%d)" > "$GO_TELEMETRY_DIR/mode";
chmod 0666 "$GO_TELEMETRY_DIR/mode";

# Remove all gathered telemetry.
[ -d "$GO_TELEMETRY_DIR/local" ] && rm -r "$GO_TELEMETRY_DIR/local";
[ -d "$GO_TELEMETRY_DIR/upload" ] && rm -r "$GO_TELEMETRY_DIR/upload";

I don't like the term telemetry, so I wasn't going to install yet another program with the term in its name just to turn off the thing!

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

No branches or pull requests

4 participants