Go 1.23 及之后的遥测 - Go 编程语言

  • Go 1.23 Telemetry Features:

    • Enables users to help improve the Go toolchain by enabling telemetry uploading, sharing data about toolchain programs and usage with the Go team.
    • By default, telemetry data is stored locally. If enabled, a limited subset is published weekly to telemetry.go.dev.
    • Can be enabled with go telemetry on and disabled with go telemetry off.
  • Telemetry History:

    • The Go team went through many iterations to find a suitable telemetry implementation that met performance, portability, and transparency requirements.
    • The initial design aimed to be unobtrusive and acceptable by default but was changed to require explicit user consent due to user concerns.
    • The new design was accepted in April 2023 and implemented over the summer.
  • Telemetry in gopls:

    • First iteration shipped in v0.14 of gopls in October 2023. Around 100 users enabled uploading initially.
    • A stack trace found in telemetry data led to a bug being reported and fixed.
    • To reach more users, a prompt was introduced in the VS Code Go plugin, and the sample grew to around 1800 weekly participants. However, it introduced a skew toward VS Code users.
    • “Telemetry wins” were discovered, such as finding long-standing bugs that would not have been found without telemetry.
  • Automated Crash Reporting in gopls:

    • Go 1.23 includes a new runtime.SetCrashOutput API for automated crash reporting.
    • Since v0.15.0, gopls reports a crash/crash stack counter when it crashes, provided it is built with Go 1.23.
    • Two bugs were found using this feature even with a small sample of users.
  • Telemetry in the Go Toolchain and Beyond:

    • Go 1.23 records telemetry within the Go toolchain, including go command and other tools.
    • Telemetry has been added to vulncheck and the VS Code Go plugin, and proposed to be added to delve.
    • The original telemetry blog series brainstormed many ideas for using telemetry to improve Go, and gopls plans to use it to improve reliability and inform decision-making.
阅读 13
0 条评论