feat(DATAGO-128305): instrument MCP connector with outbound.request.duration#1385
feat(DATAGO-128305): instrument MCP connector with outbound.request.duration#1385
Conversation
…uration Add McpRemoteMonitor extending RemoteRequestMonitor to track MCP tool call latency via OTEL histogram. Wraps tool_call() in EmbedResolvingMCPTool._execute_tool_with_audit_logs() with MonitorLatency context manager alongside existing perf_counter audit logging. Labels: service.peer.name="mcp_server", operation.name="call_tool" Error categorization: httpx.TimeoutException -> "timeout" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
✅ FOSSA Guard: Vulnerability (
|
Remove parse_error unit tests and timeout test. Keep success + failure integration tests that exercise the full MonitorLatency -> MetricRegistry pipeline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
enavitan
left a comment
There was a problem hiding this comment.
hi Jamie, looks good, left a question
| try: | ||
| result = await tool_call() | ||
| with MonitorLatency(McpRemoteMonitor.call_tool()): | ||
| result = await tool_call() |
There was a problem hiding this comment.
it doesn't look like we can distinguish the tool_name being invoked here - unless there is just one ? - can you please confirm no matter what tool is being passed here we always hit same endpoint - if this is the case we could live with this solution




Summary
McpRemoteMonitor(RemoteRequestMonitor)tocommon/observability.pyfor MCP tool call latency trackingtool_call()inEmbedResolvingMCPTool._execute_tool_with_audit_logs()withMonitorLatencycontext managertime.perf_counter()audit logging with OTEL histogramservice.peer.name="mcp_server",operation.name="call_tool",error.type(auto-set)Context
Part of DATAGO-128305 (instrument connector execution flows). Follows the
OAuthRemoteMonitorpattern from PR #1350.Companion PRs:
Resolves: DATAGO-128305
Test plan
McpRemoteMonitor.parse_error()error categorization/metricsendpoint🤖 Generated with Claude Code