Skill 2.2.6

Integrate monitoring into deployed agents, evaluate agent behavior, and perform error analysis

Key Concepts

Foundry Agent Service emits OpenTelemetry traces to the project's Application Insights resource. A trace shows each run with its model calls, tool calls, arguments, outputs, token counts and latency, and the Foundry portal shows agent metrics such as runs, errors and token use. Application code adds its own spans so the whole request is visible end to end.

Agent evaluators score behaviour: intent resolution (did the agent understand the request), task adherence (did it follow its instructions and complete the task) and tool call accuracy (did it call the right tools with correct arguments). Error analysis groups failing traces by cause, such as a missing tool, an ambiguous tool description, retrieval that found nothing or a tool error, and fixes the most frequent cause first. Continuous evaluation on sampled production traces catches regressions after changes.