Editor language server (wtctl lsp)
Shows production latency and errors above functions, with a hover for the latest issue and a trace link. Speaks LSP 3.17 over stdio.
Setup
Environment: WT_API_URL, WT_API_KEY (read scope), optional WT_WEB_URL (links; defaults to the API URL), optional WT_PROJECT (overrides project).
Repo root watchtower.yaml:
service: checkout
project: prj_...
path_prefixes: [services/checkout] # empty = whole repoBehaviour
textDocument/codeLens: "p95 120 ms · 4 errors/24h" above functions of files that map to the service. Unmapped files get no lens.textDocument/hoveron a function line: latest issue and slowest trace links.workspace/executeCommandwatchtower.openIssue/watchtower.openTracewith[project, id]returns a URL for the client to open.Data comes from
GET /v1/projects/{p}/code-stats(spans withcode.filepathandcode.function, plus error-event frames), cached 60 s server side.Privacy: only the service, file path and function names are sent. Source text never leaves the machine.
Function discovery is one regex per language (go, rs, ts/js, py, java, cs). Tree-sitter is a later improvement.
Spans need
code.filepathandcode.functionattributes (OTel semconv) to show up.