apim-kql

Generate KQL queries for Azure API Management telemetry across gateway, LLM, MCP, WebSocket logs, and Application Insights data.

970|497|Updated Apr 3, 2024
One-click install
npx skills add https://github.com/Azure-Samples/AI-Gateway --skill apim-kql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: apim-kql
Source: https://github.com/Azure-Samples/AI-Gateway/tree/main/.github/skills/apim-kql
Command: npx skills add https://github.com/Azure-Samples/AI-Gateway --skill apim-kql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enables teams to craft efficient Kusto Query Language (KQL) queries for Azure API Management telemetry in Azure Monitor, enabling fast analysis of APIM logs to improve API reliability and performance.

Core Features & Use Cases

  • KQL templates for common APIM telemetry across gateway, LLM, MCP, WebSocket, and Application Insights data.
  • Table schemas & pattern guides to join related logs for end-to-end visibility.
  • Use cases include API performance monitoring, error tracing, usage analytics, and capacity planning.

Quick Start

Start exploring with a simple gateway error query: ApiManagementGatewayLogs | where TimeGenerated > ago(24h) | where ResponseCode >= 400 | project TimeGenerated, ApiId, OperationId, ResponseCode

Frequently Asked Questions about apim-kql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write KQL queries for Azure API Management logs in Azure Monitor?

To write KQL queries for APIM logs in Azure Monitor, you query tables like ApiManagementGatewayLogs to filter telemetry by time, API, or response code. This provides ready-to-use templates for gateway, LLM, and WebSocket logs to enable fast analysis.

What's the best way to trace API errors in APIM using KQL?

The best way to trace APIM errors using KQL is to filter the ApiManagementGatewayLogs table for ResponseCode greater than or equal to 400. This isolates failed requests within your specified timeframe to quickly identify problematic APIs and operations.

Can I query LLM and WebSocket connection logs in Azure Monitor for APIM?

Yes, you can query LLM and WebSocket connection logs in Azure Monitor for APIM. The skill provides specific KQL query templates and table schemas that cover these advanced telemetry sources alongside standard gateway logs.

How does joining Application Insights data with APIM logs improve API monitoring?

Joining Application Insights data with APIM logs provides end-to-end visibility across your API gateway and backend services. This pattern allows you to correlate gateway request traces with application dependencies to improve performance analysis and error tracing.

Do I need prior KQL knowledge to analyze APIM telemetry in Azure Monitor?

No, you do not need extensive prior KQL knowledge to analyze APIM telemetry. The skill provides exact table schemas, query patterns, and common dashboard templates that guide you through performance monitoring, usage analytics, and capacity planning.

What KQL table schemas are available for APIM capacity planning and usage reporting?

Available KQL table schemas for APIM capacity planning include ApiManagementGatewayLogs and related Application Insights tables. These schemas support querying telemetry data to generate usage analytics, monitor performance metrics, and plan capacity requirements.