Skip to content

Add --debug-address flag for debug and profiling of the LSP#4437

Open
emcfarlane wants to merge 2 commits intomainfrom
ed/lspProfile
Open

Add --debug-address flag for debug and profiling of the LSP#4437
emcfarlane wants to merge 2 commits intomainfrom
ed/lspProfile

Conversation

@emcfarlane
Copy link
Copy Markdown
Contributor

Add --debug-address flag to buf lsp serve that starts a debug HTTP server (similar to gopls's --debug flag). When set, it serves a browsable debug UI with:

  • Server info and build details
  • Memory stats (runtime.MemStats)
  • pprof endpoints (goroutines, heap, allocs, block, mutex)

Usage: start the LSP with --debug-address=localhost:0 and find the assigned port in the LSP logs. Open the address in a browser to inspect server state, memory usage, goroutines, and collect CPU/heap profiles to help debug issues.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

The latest Buf updates on your PR. Results from workflow Buf CI / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 8, 2026, 3:57 PM

@emcfarlane
Copy link
Copy Markdown
Contributor Author

Screenshot 2026-04-08 at 6 01 35 PM Screenshot 2026-04-08 at 6 01 31 PM Screenshot 2026-04-08 at 6 01 27 PM Screenshot 2026-04-08 at 6 01 25 PM

Screenshots of the different views (and the familiar /debug/pprof handler).

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.

1 participant