Skip to content

Debug the agent: AI agent traces with the OpenSearch Agent Traces - #4206

Open
ps48 wants to merge 4 commits into
opensearch-project:mainfrom
ps48:blog/09-agent-traces
Open

Debug the agent: AI agent traces with the OpenSearch Agent Traces#4206
ps48 wants to merge 4 commits into
opensearch-project:mainfrom
ps48:blog/09-agent-traces

Conversation

@ps48

@ps48 ps48 commented Aug 11, 2026

Copy link
Copy Markdown
Member

Description

Adds the blog post Debug the agent: AI agent traces with the OpenSearch Agent Traces plugin, part of the OpenSearch Observability Stack SRE
blog series. The post walks an SRE through a root-cause-analysis scenario using
the Observability Stack, with freshly captured screenshots and verified
configuration.

Issues Resolved

Resolves #4205

Check List

  • Commits are signed per the DCO using --signoff
  • Update Thank You! section with contributors to this release

By submitting this pull request, I confirm that my contribution is made under
the terms of the BSD-3-Clause License.

…gent Traces plugin

Signed-off-by: Shenoy Pratik Gurudatt <sgguruda@amazon.com>
@github-actions

Copy link
Copy Markdown

Thank you for submitting a blog post!

The blog post review process is: Submit a PR -> (Optional) Peer review -> Doc review -> Marketing review -> Published.

@ps48 ps48 changed the title Debug the agent: AI agent traces with the OpenSearch Agent Traces plugin Debug the agent: AI agent traces with the OpenSearch Agent Traces Aug 11, 2026
- Point the series link to the single-pane-of-glass intro post
- Point Observability Stack links to opensearch-project/observability-stack

Signed-off-by: Shenoy Pratik Gurudatt <sgguruda@amazon.com>
@pajuric

pajuric commented Aug 11, 2026

Copy link
Copy Markdown

@kolchfa-aws - When you have a moment, please review and provide feedback.

@kolchfa-aws kolchfa-aws self-assigned this Aug 12, 2026
@kolchfa-aws kolchfa-aws added the Editorial review The blog is under editorial review label Aug 12, 2026

@kolchfa-aws kolchfa-aws left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you, @ps48. Please see my comments and let me know if you have any questions. If possible, crop the images or retake them so they have a larger font and readers can follow what is depicted on the images.


![Agent Traces Visualization tab showing a bar chart of error counts by service, with weather-agent showing execute_tool and invoke_agent errors](/assets/media/blog-images/2026-06-24-debug-the-agent-ai-agent-traces/blast-radius-visualization.png){:class="img-centered"}

The chart confirms: weather-agent accounts for the majority of errors (both `execute_tool` and `invoke_agent` spans fail), events-agent has a single tool error from a separate fault injection, and travel-planner carries `invoke_agent` errors from orchestrating the failed sub-agents. This is your blast radius: a single MCP tool returning 503 cascades up through the weather-agent and into the orchestrator.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The bar chart shows the events-agent bar in green, which the legend maps to invoke_agent, not execute_tool. The chart shows: weather-agent 6 (4 invoke_agent + 2 execute_tool), travel-planner 5, events-agent 1. The text says "the majority of errors", but really it's half of errors.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"cascades up" is a phrasal verb. Reword using a precise verb.


## The multi-agent travel planner

Before diving into the failure, look at the service topology. Navigate to **Topology Map** in the Observability Stack workspace. The Application Map shows how the travel-planner fans out to weather-agent and events-agent, both of which call the mcp-server for their tools. The weather-agent node shows a red fault indicator (20% fault rate from our injected errors).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Navigate to Topology map - is it the same as Application map? What's the actual name of the element in the UI and how exactly does the user navigate to it?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How is the 20% fault rate calculated? The traces list shows 10 traces/171 spans, the visualization shows 11 traces/205 spans.


![Agent Traces table showing 10 root-level agent invocations with timestamps, status, latency, and token counts](/assets/media/blog-images/2026-06-24-debug-the-agent-ai-agent-traces/agent-traces-list.png){:class="img-centered"}

Scan the Output column. Two traces show "Weather info temporarily unavailable" in their response, confirming partial failures. Click the Tokyo trace row to open the detail flyout.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The image on line 54 doesn't show the Output column, and all rows show "Success". Where does it show "Weather info temporarily unavailable"? What is the Tokyo trace row?


## Opening agent traces and finding the error

Navigate to **Agent Monitoring > Traces** in the left nav. The Agent Traces plugin shows root-level agent invocations with columns for Kind, Name, Status, Latency, Tokens, Input, and Output. Each row is a complete agent invocation. The metrics bar at the top shows aggregate stats: total traces, total spans, total tokens, and latency percentiles.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The Output column is not visible on the image. It does show the Time column, which is not mentioned. If the screenshot is retaken with larger font, it won't be necessary to list out the columns that the user will see in the image.


The flyout opens with the trace header (Agent badge, status, trace ID, duration, span count, token count) and a left-panel **Trace Tree** showing the full span hierarchy. You can read the execution flow directly:

```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This diagram shows the same tree as the image but more succinct. If the image has a large enough font, the diagram is not needed. Alternatively, you can remove the image. Images with a font that is not readable are not helpful for the reader to follow along.


### The scenario

We inject a `tool_error` fault into the weather agent. The MCP tool `get_current_weather` returns a 503, the weather-agent propagates a null response, and the orchestrator produces a partial result ("Weather info temporarily unavailable"). Our goal: find the failing tool call in the trace tree, inspect its error details, and measure how many requests were impacted.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reword by referring to the reader as "you". Assume that the reader is following this example and performing these steps. Use "you" and "your" instead of "we" and "our".


We inject a `tool_error` fault into the weather agent. The MCP tool `get_current_weather` returns a 503, the weather-agent propagates a null response, and the orchestrator produces a partial result ("Weather info temporarily unavailable"). Our goal: find the failing tool call in the trace tree, inspect its error details, and measure how many requests were impacted.

```bash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All code blocks must have an intro sentence ending in a colon.


Before diving into the failure, look at the service topology. Navigate to **Topology Map** in the Observability Stack workspace. The Application Map shows how the travel-planner fans out to weather-agent and events-agent, both of which call the mcp-server for their tools. The weather-agent node shows a red fault indicator (20% fault rate from our injected errors).

![Application Map showing the multi-agent travel planner service topology with travel-planner, weather-agent, events-agent, and mcp-server](/assets/media/blog-images/2026-06-24-debug-the-agent-ai-agent-traces/application-map.png){:class="img-centered"}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

All images must have an intro sentence ending in a period. Tell the reader what the reader should notice in the image ("....., as shown in the following image").


![Trace detail flyout showing the trace tree with execute_tool get_current_weather selected, displaying the ToolExecutionError and 503 status](/assets/media/blog-images/2026-06-24-debug-the-agent-ai-agent-traces/trace-tool-error.png){:class="img-centered"}

The raw span reveals everything you need for RCA:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"everything you need" is speculative. Please reword in a more neutral way.

└── chat summarize (LLM, 60ms, 831 tokens)
```

The right panel shows the selected span's details. Select `execute_tool get_current_weather` in the tree. The detail panel immediately shows "Error" with status code 2 and the exception event:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this describe the right panel before telling the reader to select the span? If so, this should be in reverse order.

…enSearch Agent Traces plugin

Signed-off-by: Shenoy Pratik Gurudatt <sgguruda@amazon.com>
@ps48

ps48 commented Aug 24, 2026

Copy link
Copy Markdown
Member Author

Thanks so much for the review, really appreciate it. I have pushed an update:

Reworded per reviewer feedback: removed metaphors and phrasal verbs (blast radius, fans out, cascades up, 30,000-foot view), switched the walkthrough to second person, and added colon lead-ins for code blocks and descriptive lead-ins for every image.
Fixed text/screenshot mismatches: corrected the bar chart breakdown (weather-agent 6 of 12 errors), used the real Application Map name, dropped the unverified 20% figure, and explained the all-Success trace list against the 12 span errors.
Note: image re-crops for larger font are still on my list and will follow in a later push.

Please take another look when you have a moment, and let me know if anything else needs changing. Happy to keep iterating.

@pajuric

pajuric commented Sep 1, 2026

Copy link
Copy Markdown

@kolchfa-aws - Can you do one more review here. Looks like there are some changes.

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
@kolchfa-aws

Copy link
Copy Markdown
Collaborator

@ps48 Editorial review complete and changes pushed to this PR. Please review my changes for accuracy, and we'll be ready for the final marketing review/publishing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-response Editorial review The blog is under editorial review New blog New blog post

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Blog] Debug the agent: AI agent traces with the OpenSearch Agent Traces

3 participants