Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add opt-in MCP transport tracing - #48

Merged
nilsavenholt merged 1 commit into
custom/v2.35.3from
feat/mcp-transport-tracing
Sep 10, 2026
Merged

nilsavenholt merged 1 commit into
custom/v2.35.3from
feat/mcp-transport-tracing

Conversation

@nilsavenholt

Copy link
Copy Markdown
Member

Summary

  • add opt-in MCP transport/session/request tracing gated by CODER_MCP_TRACE_ENABLED
  • add CODER_MCP_TRACE_RETENTION_HOURS with a 24-hour default and dbpurge cleanup
  • trace the MCP HTTP lifecycle from early ingress through auth, transport parse/dispatch, tool handler, response writes, cancellation, and completion
  • persist long-lived GET stream connection lifecycle separately from MCP session registration lifecycle
  • expose X-Coder-MCP-Trace-Id for cross-correlation with edge/Caddy logs
  • keep trace writes off the MCP request critical path via a bounded best-effort async writer
  • avoid storing request payloads, auth headers, tokens, stdin, env, or tool output
  • stop recent_activity from self-recording in the activity list it reads

Validation

  • full-stack MCP trace E2E against embedded PostgreSQL
  • MCP package tests
  • coderd trace middleware tests
  • deployment option/default/validation tests
  • DB trace lifecycle + retention tests
  • dbpurge tests
  • migration fixture suite
  • database gentest
  • race detector on trace middleware/MCP lifecycle
  • git diff --check

Operational defaults

  • tracing disabled by default
  • retention defaults to 24 hours
  • dbpurge runs at startup and every 10 minutes

@nilsavenholt
nilsavenholt merged commit 13cf5dd into custom/v2.35.3 Sep 10, 2026
28 of 33 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants