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/tools/gopls: collect editor kind information with telemetry #61038

Closed
hyangah opened this issue Jun 27, 2023 · 5 comments
Closed

x/tools/gopls: collect editor kind information with telemetry #61038

hyangah opened this issue Jun 27, 2023 · 5 comments
Labels
gopls Issues related to the Go language server, gopls. Telemetry-Accepted Telemetry-Proposal Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Jun 27, 2023

  • Counter: gopls/client:{vscode,vscodium,code-server,eglot,govim,neovim,coc.nvim,sublimetext,other}
  • Title: Editor Distribution
  • Description: measure editor distribution for gopls users.
  • Type: partition
  • Issue: go.dev/issues/61038
  • Program: golang.org/x/tools/gopls

Why?

We want to utilize this information when prioritizing editor-specific specialization and features.

Does it carry sensitive user information?

No.

How?

Some LSP clients send the name of editor in the initialization message's ClientInfo field.
Increment the counter corresponding to the field's value.

note: The default is 'local' which does not send any data to the telemetry server. Users must opt-in explicitly.

cc @golang/tools-team

@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jun 27, 2023
@gopherbot gopherbot added this to the Unreleased milestone Jun 27, 2023
@gopherbot
Copy link

Change https://go.dev/cl/506635 mentions this issue: gopls: add the "gopls/editor: telemetry counter

@adonovan
Copy link
Member

adonovan commented Jul 4, 2023

Perhaps it ought to be "gopls/client:{vscode,vscodium,eglot,...}", since it's logic in the LSP client, not the editor, that populates the field, and some editors (e.g. Emacs, Vim) have multiple clients. The editor name can be computed from the client name.

@hyangah
Copy link
Contributor Author

hyangah commented Jul 17, 2023

Updated to "gopls/client:..." cc @jamalc

leitzler added a commit to govim/govim that referenced this issue Jul 29, 2023
LSP 3.15.0 added support for sending information about the client as
part of the InitializeParams message. This change will make govim send
it's name and version as a part of that message to gopls.

Also see golang/go#61038.
gopherbot pushed a commit to golang/tools that referenced this issue Aug 1, 2023
These counters are incremented once per session
when the LSP initialize message is received.

This cl adds a new dependency on x/telemetry.

Note that writing to the disk will be enabled when
GOPLS_TELEMETRY_EXP is set. We plan to remove this
condition once we are ready.

Updates golang/go#61038

Change-Id: Ibb8ebbd039ab5ffbaa869dee01bee0ba5450f350
Reviewed-on: https://go-review.googlesource.com/c/tools/+/506635
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
bhcleek added a commit to bhcleek/vim-go that referenced this issue Aug 2, 2023
@pjweinb
Copy link

pjweinb commented Aug 15, 2023

add gopls/clietn:vscode-insiders perhaps?

@hyangah
Copy link
Contributor Author

hyangah commented Aug 23, 2023

@pjweinb #62214 proposes it.

@hyangah hyangah closed this as completed Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls Issues related to the Go language server, gopls. Telemetry-Accepted Telemetry-Proposal Tools This label describes issues relating to any tools in the x/tools repository.
Projects
Development

No branches or pull requests

6 participants