Agent Harness Tutorial · End to end · Zoom level 3
Where it lands: App Insights and Log Analytics
On Azure everything the agent records ends up in one place: a Log Analytics workspace. Application Insights is "workspace-based", which means it has no store of its own: its traces, requests, metrics and exceptions are tables in the workspace, next to the container logs. Every question you ask, every alert, and the transaction view in the portal is a KQL query over these tables.
| Table | One row is | Key columns we use |
|---|---|---|
| AppDependencies | one of our spans (agent.turn, gen_ai.chat, agent.tool, agent.policy ...) | Name, DurationMs, Success, SessionId (= conversation id), OperationId (= trace), Properties["agent.*"] |
| AppRequests | one call through APIM, logged by APIM itself | Name (e.g. chat/completions), ResultCode, DurationMs |
| AppMetrics | one aggregated metric value | Name (agent.turns, agent.spend ...), Sum, Count, Properties (labels) |
| AppExceptions | an exception recorded on a span | ProblemId, OuterMessage, OperationId |
| ContainerAppConsoleLogs_CL | a line the container printed | ContainerAppName_s, RevisionName_s, Log_s |
| ContainerAppSystemLogs_CL | a platform event: start, restart, crash | Reason_s, Log_s |
Following one turn. Every span of a turn shares one OperationId, and SessionId holds the conversation id. In the portal: Application Insights → Transaction search → the SessionId. In KQL:
AppDependencies
| where SessionId == "cnv_964aee272863061a"
| project TimeGenerated, Name, DurationMs, Success,
route = tostring(Properties["agent.route.kind"]),
cost = todouble(Properties["agent.cost.usd"])
| order by TimeGenerated asc