Skip to content

Bug: Go 1.23+ ignores custom GOTELEMETRY/GOTELEMETRYDIR settings via env vars or go env config file #72756

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
ChipZhang opened this issue Mar 9, 2025 · 3 comments

Comments

@ChipZhang
Copy link

ChipZhang commented Mar 9, 2025

Go version

1.23.x, 1.24.x

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/user/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/my/go/1.23.7'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/my/go/1.23.7/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.7'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
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 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1972920973=/tmp/go-build -gno-record-gcc-switches'

What did you do?

  1. Set custom GOTELEMETRY and GOTELEMETRYDIR via env vars (for example set it in ~/.profile):
export GOTELEMETRYDIR=/another/path
export GOTELEMETRY=off
  1. check that the system env vars already take effect, env|grep GOTELE prints:
GOTELEMETRYDIR=/another/path
GOTELEMETRY=off
  1. go commands still uses the default settings, for example, go env | grep GOTELE still prints:
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/user/.config/go/telemetry'
  1. Set custom GOTELEMETRY and GOTELEMETRYDIR via go env config file than system env vars , still no use.

What did you see happen?

go command forces use default GOTELEMETRYDIR and GOTELEMETRY, and ignores custom settings.

What did you expect to see?

As per the doc,
go command should respect GOTELEMETRYDIR and GOTELEMETRY env var settings.

@ChipZhang ChipZhang changed the title Go 1.23+ ignores GOTELEMETRY/GOTELEMETRYDIR env vars Go 1.23+ ignores custom GOTELEMETRY/GOTELEMETRYDIR settings via env vars or go env config file Mar 9, 2025
@ChipZhang ChipZhang changed the title Go 1.23+ ignores custom GOTELEMETRY/GOTELEMETRYDIR settings via env vars or go env config file Bug: Go 1.23+ ignores custom GOTELEMETRY/GOTELEMETRYDIR settings via env vars or go env config file Mar 9, 2025
@seankhliao
Copy link
Member

as the documentation notes, these are read only variables
https://pkg.go.dev/cmd/go#hdr-Manage_telemetry_data_and_settings

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 9, 2025
@zigo101
Copy link

zigo101 commented Mar 10, 2025

This is really confused. See #68928 #68930 #68936

@sosy-china
Copy link

ln -sf /tmp/golang-telemetry /home/xxx/.config/go/telemetry

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