Skill 3.3.5

Implement tracing in Foundry, including tokens, prompts, correlation IDs, alerting, and execution tracking

Key Concepts

A Foundry project is connected to an Application Insights resource. Foundry Agent Service traces agent runs automatically, and application code uses the Azure Monitor OpenTelemetry distribution with OpenAI and Agent Framework instrumentation. Spans follow the GenAI semantic conventions and include the operation, model, input and output tokens and finish reason. Prompts and completions are recorded only when content capture is enabled.

Correlation IDs (the trace ID plus business IDs such as a case number as span attributes) link spans across agents and services. Execution tracking shows the sequence of agent invocations, tool calls and hand-offs in the Foundry portal's trace view. Alerting uses Azure Monitor log search or metric alerts on the trace data, for example on error rate, token spikes or long runs.