Search and analyze AI agent logs in OpenSearch to monitor requests, investigate errors,
troubleshoot issues, and review tool execution across AI Agent and MCP servers.
Before you begin
Make sure that you have access to the OpenSearch dashboard.
About this task
OpenSearch provides centralized access to AI agent logs from the AI Agent and Model Context
Protocol (MCP) servers. You can search, filter, and export log data to monitor agent activity,
investigate request processing, troubleshoot issues, and analyze tool execution.
AI agent logs help you complete the following actions.
- View application and access logs from the AI Agent and MCP servers.
- Monitor agent requests and responses.
- Investigate errors and tool execution.
- Export log data for troubleshooting, auditing, and offline analysis.
Procedure
-
On the OpenSearch dashboard, select Discover to
the search interface.
- Click Add filter.
- In the Edit filter modal, in the Field
field, select type.
- In the Operator field, select is one
of.
- In the Values field, select one of the log types in Table 1.
Table 1. Log type
options
| Log type |
Description |
| ai-agent-message |
Application messages that are generated during agent execution, including routing decisions,
tool calls, errors, and debug output. Emitted by the AI Agent server. This log type includes the
ext_agentID and ext_agentSource fields to identify the
agent that generated the log and whether it is a base or custom agent. |
| ai-agent-access |
One entry for each inbound HTTP request to the AI Agent server, including the HTTP method,
request URL, and response status code. |
| ai-mcp-message |
Application messages that are generated during MCP tool execution, including tool calls,
errors, and debug output. Emitted by the MCP server. This log type includes the
server field to identify the MCP server instance that generated the
log. |
| ai-mcp-access |
One entry for each inbound HTTP request to the MCP server, including the HTTP method, request
URL, and response status code. |
- Set the date range that you want to analyze.
- Optional: In the search bar, enter a keyword, request ID, error message, or
other search criteria to narrow the results.
- Optional: In the field selector, select the data fields that you want to
display.
For example, the following fields might be useful.
- timestamp
- message
- ext_requestId
- Review the results that are displayed.
- Optional: To export the search results, click Download as
CSV.
What to do next
After you review or export the logs, you can use the data to complete the following actions.
- Investigate agent execution issues and request failures.
- Analyze tool execution and identify errors.
- Correlate related log entries by using request identifiers.
- Monitor request volume and response status.
- Share exported log data with development or support teams to help with troubleshooting and root
cause analysis.