Open matloob opened 2 weeks ago
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. — rsc for the proposal review group
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:
mode: on
start: 2024-05-08T15:10:51-04:00
dir: /Users/matloob/Library/Application Support/go/telemetry
Config -json prints:
{
"Mode": "on",
"Start": "2024-05-08T15:10:51-04:00",
"Dir": "/Users/matloob/Library/Application Support/go/telemetry"
}
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 go telemetry view -json
that doesn't show the charts with JS, but does give access to the raw data?
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:
go telemetry
prints the mode: either on
, off
or local
go telemetry on
sets the mode to on
go telemetry local
sets the mode to local
go telemetry off
sets the mode to off
New unsettable GOTELEMETRY
and GOTELEMETRYDIR
variables are displayed go env
containing the telemetry mode (on
, off
, or local
) and the telemetry directory.
go clean -telemetry
cleans the telemetry directory.
Change https://go.dev/cl/584535 mentions this issue: cmd/go: add go telemetry command and support in env and clean
No change in consensus, so accepted. 🎉 This issue now tracks the work of implementing the proposal. — rsc for the proposal review group
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:
mode: on
start: 2024-05-08T15:10:51-04:00
dir: /Users/matloob/Library/Application Support/go/telemetry
Config -json prints:
{
"Mode": "on",
"Start": "2024-05-08T15:10:51-04:00",
"Dir": "/Users/matloob/Library/Application Support/go/telemetry"
}
Config is a simplification of “gotelemetry env”, which will probably be deleted in favor of this config command.
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.