Skip to content

Add MCP server context to otel tool_result logs#12267

Merged
colby-oai merged 9 commits intomainfrom
dev/colby-oai/otel-logs-include-mcp-server-info
Feb 20, 2026
Merged

Add MCP server context to otel tool_result logs#12267
colby-oai merged 9 commits intomainfrom
dev/colby-oai/otel-logs-include-mcp-server-info

Conversation

@colby-oai
Copy link
Contributor

@colby-oai colby-oai commented Feb 19, 2026

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)

}
}

async fn resolve_mcp_tool_result_fields(
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you inline this if don't use it more than once?

@colby-oai colby-oai force-pushed the dev/colby-oai/otel-logs-include-mcp-server-info branch from e504b3a to 0330131 Compare February 19, 2026 21:08
@colby-oai colby-oai force-pushed the dev/colby-oai/otel-logs-include-mcp-server-info branch from 04b6ffc to 531688d Compare February 19, 2026 22:06
@colby-oai colby-oai merged commit 2036a5f into main Feb 20, 2026
33 checks passed
@colby-oai colby-oai deleted the dev/colby-oai/otel-logs-include-mcp-server-info branch February 20, 2026 15:26
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants