docs: add KQL query library section to telemetry.md#109
Conversation
Adds a new 'Querying Traces in Azure Monitor (KQL)' section with 5 ready-to-use KQL queries for users who send eval traces to Azure Monitor / Application Insights: 1. Slowest evaluation rows (top N eval_item spans by duration) 2. Failed evaluators (filter by passed == false with scores and thresholds) 3. Pass rate over time (trend from root spans with timechart render) 4. Token usage per run (sum input + output tokens by operation_Id) 5. Evaluator score distribution (stats by evaluator name) Includes a table mapping explaining which AgentOps spans land in which App Insights tables (requests vs dependencies). All attribute names verified against telemetry.py source code. Closes #89 Generated with [Amplifier](https://github.com/microsoft/amplifier) Co-Authored-By: Amplifier <240397093+microsoft-amplifier@users.noreply.github.com>
5a87299 to
2fafd68
Compare
Validated end-to-end against Jaeger and Azure Monitor (OTel Collector proxy + App Insights KQL queries 1-5). Adjustments: - Use 1-based eval_item indices and include the input snippet that the runner actually puts in the span name (eval_item N - '<input>'). - Add cicd.pipeline.task.run.id / .run.result to the eval_item example; these are emitted by telemetry.py but were missing from the doc. - Remove agentops.eval.item.expected from the trace tree and the attribute table; the attribute is never populated because the runner does not pass expected_text into eval_item_span. - Clarify that gen_ai.provider.name varies by backend (azure.ai.inference for Foundry, local.callable for local adapter). - Note that item.index is 1-based. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Option B told users to set AGENTOPS_OTLP_ENDPOINT directly to a 'https://<region>.applicationinsights.azure.com' URL, but our exporter sends plain OTLP/HTTP with no Authorization header. App Insights does not accept that: - The Azure Monitor OpenTelemetry distro (https://learn.microsoft.com/azure/azure-monitor/app/opentelemetry-configuration?tabs=python) requires a connection string and configure_azure_monitor(), not a raw OTLP endpoint. - The preview 'Microsoft.Insights/OtlpApplicationInsights' direct OTLP ingestion requires Entra ID Bearer-token auth (scope https://monitor.azure.com/.default), which telemetry.py does not inject today. Replace the two-option layout with a single recommended path (the Collector proxy, validated end-to-end against App Insights) and an explanatory subsection covering why direct export from AgentOps is not supported. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Follow-up: E2E validation + doc fixesI ran the entire telemetry.md end-to-end against both Jaeger (local) and Azure Monitor / Application Insights (via the OTel Collector proxy) using a minimal local-adapter eval, then pushed two follow-up commits with documentation fixes for the discrepancies I found. Commits pushed
What was validated end-to-end (all ✅)
Doc fixes applied (
|
Closes #89
Summary
Adds a new "Querying Traces in Azure Monitor (KQL)" section to
docs/telemetry.mdwith 5 ready-to-use KQL queries for users who send eval traces to Azure Monitor / Application Insights.What's Added
New section inserted between "Sending Traces to Azure Monitor" and "Evaluation Tracing vs. Agent Execution Tracing" containing:
requestsvsdependenciestableseval_itemspans by durationagentops.eval.evaluator.passed == Falseagentops.eval.pass_ratefrom root spans with timechartgen_ai.usage.input_tokens+output_tokensper operationVerification
src/agentops/utils/telemetry.pysource codecustomDimensions)customDimensions["attribute.name"]