Skip to content

Add perf / project telemetry#3257

Open
jakebailey wants to merge 7 commits intomainfrom
jabaile/telemetry-metrics
Open

Add perf / project telemetry#3257
jakebailey wants to merge 7 commits intomainfrom
jabaile/telemetry-metrics

Conversation

@jakebailey
Copy link
Copy Markdown
Member

This adds events to:

  • Project info telemetry, like Strada, with file counts, compiler options (sanitized of course), etc. Sent when we first discover a project, same as Strada.
  • Periodically (every 5 mins) send performance info like memory usage, total memory, GC count, allocs, inuse space etc. Plus, the auto import stats. This is new to Corsa.

I added an initialization option that toggles telemetry wholesale; the client is already supposed to ignore it if it doesn't care, but best to not enable it when not needed. Of course, as per usual, telemetry is managed by VS Code and can be controlled like any other extension (and it's all just stats anyway). So the toggle is just for efficiency / testing reasons.

The goal of is is so we can gauge how much we are impacting memory usage. I want to start tweaking GOGC and GOMEMLIMIT but would like to be able to see that it's doing anything.

This introduces a new dep in order to get cross-platform memory info in pure Go.

@jakebailey jakebailey marked this pull request as ready for review March 27, 2026 20:20
Copilot AI review requested due to automatic review settings March 27, 2026 20:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds opt-in telemetry emission from the native TypeScript language server to help measure project characteristics and ongoing runtime/performance behavior (memory/GC/auto-import stats), with a new initialization option to enable/disable telemetry.

Changes:

  • Introduces enableTelemetry initialization option and plumbs it through LSP server → project session.
  • Adds new telemetry event shapes (projectInfo, performanceStats) to lsproto and sends them from internal/project/session.go.
  • Adds a cross-platform system memory dependency and updates mocks/tests for the expanded project.Client interface.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/testutil/projecttestutil/clientmock_generated.go Updates generated client mock to support SendTelemetry.
internal/project/session.go Implements periodic performance telemetry and one-time project info telemetry; adds telemetry option and session start time.
internal/project/extendedconfigcache_test.go Updates test client to satisfy new project.Client interface (SendTelemetry).
internal/project/client.go Extends project.Client with SendTelemetry.
internal/lsp/server.go Implements SendTelemetry on the server and wires enableTelemetry init option into session options and panic telemetry gating.
internal/lsp/lsproto/lsp_generated.go Adds new telemetry event types/unions and enableTelemetry initialization option to generated protocol types.
internal/lsp/lsproto/_generate/generate.mts Updates generator model with new telemetry events and validates telemetry event measurement/property shapes.
go.mod Adds github.com/mackerelio/go-osstat for system memory metrics.
_extension/src/client.ts Enables telemetry in initialization options (currently hard-coded true).

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

Successfully merging this pull request may close these issues.

2 participants