Add MCP server context to otel tool_result logs (#12267)

Summary
- capture the origin for each configured MCP server and expose it via
the connection manager
- plumb MCP server name/origin into tool logging and emit
codex.tool_result events with those fields
- add unit coverage for origin parsing and extend OTEL tests to assert
empty MCP fields for non-MCP tools
- currently not logging full urls or url paths to prevent logging
potentially sensitive data

Testing
- Not run (not requested)
This commit is contained in:
colby-oai
2026-02-20 10:26:19 -05:00
committed by GitHub
parent ede561b5d1
commit 2036a5f5e0
5 changed files with 148 additions and 0 deletions

View File

@@ -44,6 +44,8 @@ fn runtime_metrics_summary_collects_tool_api_and_streaming_metrics() -> Result<(
true,
"ok",
&[],
None,
None,
);
manager.record_api_request(1, Some(200), None, Duration::from_millis(300));
manager.record_websocket_request(Duration::from_millis(400), None);