Search Traces — Conversation-Level Search
Search agent traces at the conversation level. Returns summaries grouped by conversation or operation, not individual spans.
Prerequisites
- App Insights resource resolved (see trace.md Before Starting)
- Selected agent root, environment, effective context source, and metadata overlay confirmed
- Time range confirmed with user (default: last 24 hours)
Search by Conversation ID
Keep the selected environment visible in the summary, and add the selected agent name or environment tag filters when the telemetry emits them.
dependencies
| where timestamp > ago(24h)
| where customDimensions["gen_ai.conversation.id"] == "<conversation_id>"
| project timestamp, name, duration, resultCode, success,
operation = tostring(customDimensions["gen_ai.operation.name"]),
model = tostring(customDimensions["gen_ai.request.model"]),
inputTokens = toint(customDimensions["gen_ai.usage.input_tokens"]),
outputTokens = toint(customDimensions["gen_ai.usage.output_tokens"]),
operation_Id, id, operation_ParentId
| order by timestamp ascSearch by Response ID
Auto-detect the response ID format to determine agent type:
caresp_...→ Hosted agent (AgentServer)resp_...→ Prompt agent (Foundry Responses API)chatcmpl-...→ Azure OpenAI chat completions
dependencies
| where timestamp > ago(24h)
| where customDimensions["gen_ai.response.id"] == "<response_id>"
| project timestamp, name, duration, resultCode, success,
operation = tostring(customDimensions["gen_ai.operation.name"]),
model = tostring(customDimensions["gen_ai.request.model"]),
inputTokens = toint(customDimensions["gen_ai.usage.input_tokens"]),
outputTokens = toint(customDimensions["gen_ai.usage.output_tokens"]),
operation_Id, id, operation_ParentIdThen drill into the full conversation:
⚠️ STOP — read Conversation Detail before writing your own drill-down query. It contains the correct span tree reconstruction logic, event/exception queries, and eval correlation steps.
Quick drill-down using the operation_Id from above:
dependencies
| where operation_Id == "<operation_id_from_above>"
| project timestamp, name, duration, resultCode, success,
spanId = id, parentSpanId = operation_ParentId,
operation = tostring(customDimensions["gen_ai.operation.name"]),
model = tostring(customDimensions["gen_ai.request.model"]),
inputTokens = toint(customDimensions["gen_ai.usage.input_tokens"]),
outputTokens = toint(customDimensions["gen_ai.usage.output_tokens"]),
responseId = tostring(customDimensions["gen_ai.response.id"]),
errorType = tostring(customDimensions["error.type"]),
toolName = tostring(customDimensions["gen_ai.tool.name"])
| order by timestamp ascAlso check for eval results: see Eval Correlation.
Search by Agent Name
Note: For hosted agents,
gen_ai.agent.nameindependenciesrefers to sub-agents (e.g.,BingSearchAgent), not the top-level hosted agent. See "Search by Hosted Agent Name" below.