-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
cmd/go: add go telemetry subcommand #67111
Comments
This proposal is only about adding the on/off/local functionality, not telemetry itself. The effect is that users dont have to go install golang.org/x/telemetry/cmd/gotelemetry@latest to configure telemetry settings. That's clearly a good thing. I think this is unobjectionable enough that we can move this to likely accept. |
Based on the discussion above, this proposal seems like a likely accept. The proposal is to add a “go telemetry” sub-command with these sub-sub-commands: on, off, local, clean, and config. On, off, and local set the telemetry mode. Clean deletes all telemetry data. These match golang.org/x/telemetry/cmd/gotelemetry. Config prints the telemetry config, like this:
Config -json prints:
Config is a simplification of “gotelemetry env”, which will probably be deleted in favor of this config command. |
One question - isn't there a tradeoff worth consider in supporting Seems like from an impl standpoint it'll be cheap, and from usability standpoint it will give people a great sense of transparency about what the telemetry actually is. |
@TheCoreMan I think it would be pretty hard for a user to see what's going on by looking at the raw data, especially if we included all counters being written to disk, not just those being uploaded. If we included only those being uploaded it could be more reasonable, but to me the html view is more user friendly and it's a good display of both what's collected locally and what's uploaded, so we should encourage users to look there. |
I'd like to update the proposal to make it a bit simpler by adopting a suggestion from @hyangah:
New unsettable
|
Change https://go.dev/cl/584535 mentions this issue: |
No change in consensus, so accepted. 🎉 The proposal is to add a “go telemetry” sub-command with these sub-sub-commands: on, off, local, clean, and config. On, off, and local set the telemetry mode. Clean deletes all telemetry data. These match golang.org/x/telemetry/cmd/gotelemetry. Config prints the telemetry config, like this:
Config -json prints:
Config is a simplification of “gotelemetry env”, which will probably be deleted in favor of this config command. |
Add the go telemetry command to support setting and viewing the telemetry mode. Also add the non-settable GOTELEMETRY and GOTELEMETRYDIR variables to go env, which contain the mode and telemetry dir. For #67111 Change-Id: Id7e89cefe30acfe3d865fa467315fe7cda975de9 Reviewed-on: https://go-review.googlesource.com/c/go/+/584535 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Sam Thanawalla <samthanawalla@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
We've decided to simplify the proposal to that in #67111 (comment) :
This has been submitted. |
Change https://go.dev/cl/587923 mentions this issue: |
This change fills in the release notes for the go telemetry command as well as the unsettable GOTELEMETRY and GOTELEMETRYDIR go env values. For #67111 Change-Id: Id6943f79f7ab2457787e1639d8d5fb1c1e2649dc Reviewed-on: https://go-review.googlesource.com/c/go/+/587923 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Sam Thanawalla <samthanawalla@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Looks like the clean support is missing. |
@zhsj Apologies for not updating this issue. It was decided to leave clean in the |
Can you elaborate on why it was decided these would be unsettable? (Apologies if this was discussed somewhere already, I'm not seeing it here. 😭 ❤️) (Asking because if they were settable via environment variables, I'd be much more likely to enable them in more places because it would be trivial for me to do so. 😞) |
Even with that proposal, though, GOTELEMETRY=on would not be settable because we want users to explicitly enable telemetry using go telemetry on. @matloob Why? |
Update: See #67111 (comment) for the current version of the proposal.
Original version of the proposal:
Proposal Details
This is a proposal to add a new
go telemetry
subcommand, which would have implement the behavior of theon
,local
,off
, andclean
subcommands of thegolang.org/x/telemetry/cmd/gotelemetry
command, as well as a new config command which is a clearer version ofgotelemetry env
:go telemetry on
: same behavior asgotelemetry on
:enable telemetry collection and uploading
go telemetry local
: same behavior asgotelemetry local
:enable telemetry collection but disable uploading
go telemetry off
: same behavior asgotelemetry off
:disable telemetry collection and uploading
go telemetry config [-json]
: print the go telemetry config: including the mode, start time and directory optionally in JSON formatgo telemetry clean
: same behavior asgotelemetry clean
:remove all local telemetry data
If implemented, we would refactor the
gotelemetry
command so thatgo telemetry
could call into the same code.The rationale for this proposal is that we want to add this to make it easy for users of the
go
command to modify their telemetry collection settings. This is particularly useful because we're adding opt-in telemetry to the Go toolchain (#58894). With this change, users wouldn't need to install the gotelemetry command on their system to modify their telemetry collection settings.This proposal wouldn't add the functionality of the
gotelemetry view
command: that command has JavaScript dependencies that we do not want to add to the main Go repo.The text was updated successfully, but these errors were encountered: