azure-samples/ai-gateway/apim-kql
Claude Code and agent skill by azure-samples/ai-gateway
- community
Checking that the SKILL.md file is still in the repository.
Guide for creating Kusto Query Language (KQL) queries for Azure API Management tables in Azure Monitor (Log Analytics Workspace). Use when users want to query, analyze, or monitor APIM logs including gateway logs, LLM/AI logs, MCP logs, WebSocket logs, and Application Insights data. This skill provides KQL syntax, table schemas, and query patterns for APIM monitoring scenarios.
Install
npx vskill@latest install azure-samples/ai-gateway/apim-kqlSKILL.md
APIM KQL Skill
Guide for creating Kusto Query Language (KQL) queries for Azure API Management monitoring data in Azure Monitor.
Quick Start
Basic Gateway Logs Query
LLM Token Usage Query
Tables Overview
| Table | Description | Use Case | |
|---|---|---|---|
ApiManagementGatewayLogs | Gateway request/response logs | API traffic analysis, errors, latency | |
ApiManagementGatewayLlmLog | LLM/AI model usage logs | Token usage, model performance | |
ApiManagementGatewayMCPLog | MCP server logs | MCP tool calls, sessions | |
ApiManagementWebSocketConnectionLogs | WebSocket connection events | Real-time API monitoring | |
AppRequests | Application Insights requests | End-to-end request tracking | |
AppMetrics | Application Insights metrics | Custom metrics analysis | |
AppTraces | Application Insights traces | Debug and diagnostic traces |
For complete table schemas, see references/table-schemas.md.
Essential Query Patterns
Joining LLM Logs with Gateway Logs
Error Analysis
Request Latency Analysis
Backend Performance
Token Usage by Time
MCP Tool Usage
WebSocket Connection Events
KQL Operators Reference
Filtering
Aggregation
Time Functions
Joins
Projections
Ordering and Limiting
Common Scenarios
Daily Request Summary
Top Consumers by Token Usage
Error Rate Over Time
Cache Hit Analysis
Streaming vs Non-Streaming LLM Requests
Running KQL Queries
Azure CLI
Python
Best Practices
- Always filter by time - Use
where TimeGenerated > ago(...)to limit data scanned - Use summarize early - Aggregate data before joins when possible
- Project only needed columns - Reduce data transfer with explicit projections
- Use let statements - Break complex queries into readable parts
- Join on CorrelationId - Link APIM tables together using this common key
- Use bin() for time series - Group time data into meaningful intervals
References
- references/table-schemas.md - Complete table column definitions
- references/query-examples.md - Additional query examples from this repository
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/apim-kql/SKILL.md
Popularity
- Repository stars
- 891
- Repository forks
- 403
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/azure-samples/ai-gateway/apim-kql)