Skip to content

fix: include _internal/mcp in observability tracing paths#4144

Open
ecthelion77 wants to merge 1 commit intoIBM:mainfrom
forterro:fix/observability-internal-mcp-tracing-upstream
Open

fix: include _internal/mcp in observability tracing paths#4144
ecthelion77 wants to merge 1 commit intoIBM:mainfrom
forterro:fix/observability-internal-mcp-tracing-upstream

Conversation

@ecthelion77
Copy link
Copy Markdown
Contributor

@ecthelion77 ecthelion77 commented Apr 13, 2026

🐛 Bug-fix PR

🔗 Issue

Closes #4152

📌 Summary

The _internal/mcp endpoint path is not included in the observability tracing include patterns, causing internal MCP calls between gateway components to be invisible in distributed traces. This makes it impossible to trace the full request flow when meta-servers or virtual servers invoke internal MCP endpoints.

🔁 Reproduction Steps

  1. Configure a meta-server that calls internal MCP endpoints via /_internal/mcp/
  2. Send a request that triggers the meta-server
  3. Check traces in your observability backend (Jaeger/Tempo)
  4. Notice that the /_internal/mcp leg is missing from the trace

🐞 Root Cause

The OTEL_TRACE_INCLUDE_PATTERNS default in config.py lists explicit path patterns for tracing (/servers/*/sse, /servers/*/message, /a2a), but /_internal/mcp was omitted.

💡 Fix Description

Add r"^/_internal/mcp(?:/|$)" to the default OTEL_TRACE_INCLUDE_PATTERNS list in Settings, so internal MCP calls are traced by default.

🧪 Verification

Check Command Status
Lint suite make lint
Unit tests make test
Coverage ≥ 80 % make coverage
Manual regression no longer fails Verified traces include /_internal/mcp spans

📐 MCP Compliance (if relevant)

  • Matches current MCP spec
  • No breaking change to MCP clients

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • No secrets/credentials committed

@ecthelion77
Copy link
Copy Markdown
Contributor Author

Suggested labels: bug, COULD, python, observability

@ecthelion77 ecthelion77 force-pushed the fix/observability-internal-mcp-tracing-upstream branch from 479336e to b8ca51e Compare April 14, 2026 12:46
@ecthelion77 ecthelion77 force-pushed the fix/observability-internal-mcp-tracing-upstream branch 3 times, most recently from 58810c3 to 2356112 Compare April 14, 2026 15:35
Signed-off-by: Olivier Gintrand <olivier.gintrand@forterro.com>
@ecthelion77 ecthelion77 force-pushed the fix/observability-internal-mcp-tracing-upstream branch from 2356112 to 3ccf338 Compare April 14, 2026 15:43
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.

[BUG][OBSERVABILITY]: Internal MCP endpoint (/_internal/mcp) excluded from tracing — invisible in distributed traces

1 participant