Skip to content

feat(DATAGO-128305): instrument MCP connector with outbound.request.duration#1385

Closed
JKaram wants to merge 2 commits intomainfrom
JKaram/DATAGO-128305/otel-mcp-connector
Closed

feat(DATAGO-128305): instrument MCP connector with outbound.request.duration#1385
JKaram wants to merge 2 commits intomainfrom
JKaram/DATAGO-128305/otel-mcp-connector

Conversation

@JKaram
Copy link
Copy Markdown
Contributor

@JKaram JKaram commented Apr 13, 2026

Summary

  • Add McpRemoteMonitor(RemoteRequestMonitor) to common/observability.py for MCP tool call latency tracking
  • Wrap tool_call() in EmbedResolvingMCPTool._execute_tool_with_audit_logs() with MonitorLatency context manager
  • Supplements existing time.perf_counter() audit logging with OTEL histogram
  • Labels: service.peer.name="mcp_server", operation.name="call_tool", error.type (auto-set)

Context

Part of DATAGO-128305 (instrument connector execution flows). Follows the OAuthRemoteMonitor pattern from PR #1350.

Companion PRs:

  • solace-agent-mesh-core-plugins: SQL connector instrumentation
  • solace-agent-mesh-enterprise: Bedrock KB connector instrumentation

Resolves: DATAGO-128305

Test plan

  • Unit tests for McpRemoteMonitor.parse_error() error categorization
  • Async tests verifying metric recording on success/failure/timeout
  • Manual verification: run with MCP connector, check /metrics endpoint

🤖 Generated with Claude Code

…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>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 13, 2026

⚠️ FOSSA Guard: Licensing (SolaceLabs_solace-agent-mesh) • 1 flagged • 3 issues

Compared against main (72abda3d9b6b3f38a5f72a6a1a26d2daba4f1762) • 4 new, 8 total (6 in base)

ℹ️ Privacy mode enabled - detailed violation information hidden.

  • Flagged by Policy: 1 issue(s)
  • Other: 3 issue(s)

Scan Report | View Details in FOSSA

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 13, 2026

✅ FOSSA Guard: Vulnerability (SolaceLabs_solace-agent-mesh) • PASSED

Compared against main (72abda3d9b6b3f38a5f72a6a1a26d2daba4f1762) • 0 new, 0 total (22 in base)

Scan Report | View Details in FOSSA

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>
@sonarqube-solacecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@enavitan enavitan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi Jamie, looks good, left a question

try:
result = await tool_call()
with MonitorLatency(McpRemoteMonitor.call_tool()):
result = await tool_call()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@JKaram JKaram closed this May 5, 2026
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.

2 participants