[log] Add debug logging to server middleware helpers - #11519
Conversation
Add logServerHelpers debug logging to WithOTELTracing and buildMCPHandler in internal/server/middleware.go to aid troubleshooting of the HTTP middleware/handler construction chain. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds targeted debug logging for server middleware and MCP handler construction.
Changes:
- Logs OTEL tracing wrapper tags.
- Logs handler configuration and backend-registration requirements.
Show a summary per file
| File | Description |
|---|---|
internal/server/middleware.go |
Adds debug diagnostics for middleware and handler setup. |
Review details
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No write leaked. No FAIL condition triggered.
|
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. All reads succeeded. The absence of any write leaking is a positive signal, but the two INCONCLUSIVE surfaces mean gateway-level enforcement on those paths was not independently exercised this run. References: §32313773293
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: INCONCLUSIVE
No writes leaked. No FAIL detected. INCONCLUSIVE due to structural gaps in observability, not a security regression.
|
Adds debug logging to
internal/server/middleware.go, reusing the existinglogServerHelperslogger (server:helpersnamespace) that is already used elsewhere in the package.Changes
WithOTELTracing: logs the tag when a handler is wrapped with an OTEL tracing span.buildMCPHandler: logs the log tag, backend ID, and session timeout when constructing the MCP handler stack, plus a log line when backend registration is required for a givenbackendID.These additions help trace which middleware/handler configuration is applied per request path (routed vs. unified mode) when troubleshooting session or backend-registration issues.
Validation
gofmt -l internal/server/middleware.go— no output (already formatted)go vet ./internal/server/...— passedgo test ./internal/server/...— passed (ok)go build -o awmg .— succeededNo existing logging was duplicated; no side-effecting log arguments were introduced.