When my agent is slow or wrong, where do I even look?

Microsoft Developer walks through a practical workflow for figuring out why an AI agent is slow or producing incorrect answers, using tracing in Azure AI Foundry and Azure Application Insights.

Overview

The video focuses on diagnosing two common agent problems:

The core idea is that without traces you’re guessing whether the issue is:

With tracing enabled, you can inspect an agent run end-to-end and pinpoint the exact step that was slow or incorrect.

Enabling tracing with Azure AI Foundry + Application Insights

Reading an agent run span-by-span

Once tracing is enabled, you can inspect a single agent run as a sequence of spans, including:

This lets you identify:

Querying traces to find patterns with KQL

After identifying an issue in a single run, the video shows using KQL queries in Application Insights to determine whether: