Exception Analytics Dashboard – KQL Queries
This document details a set of Kusto Query Language (KQL) queries used to analyze and visualize exception logs from Azure Application Insights. These queries break down exceptions by various dimensions — such as tenant, request path, program, or job name — to help monitor system health and troubleshoot issues effectively.
Note:
The Application Insights log queries in this section are applicable to deployments where Azure Application Insights is enabled (typically Azure-hosted environments).
📊 Tenant-wise Count of Exceptions in the Given Time Range
Title: Tenant-wise Exception Count
Query
exceptions
| where itemType == "exception" and isnotempty(customDimensions.TenantId)
| extend
TenantId = tostring(customDimensions.TenantId)
| summarize ExceptionCount = count() by TenantId
| order by ExceptionCount desc
Description
Counts the number of exceptions per tenant within the selected time range. It filters exception logs containing a TenantId, groups results by TenantId, and summarizes the total exceptions for each. The chart orders tenants by exception count in descending order, highlighting which tenants face the most issues.
Chart Example:

📊 Exception Type Counts by Tenant in the Selected Time Range
Title: Exception Counts Grouped by Type and Tenant
Query
exceptions
| where itemType == "exception"
and isnotempty(customDimensions.TenantId)
| extend
ExceptionType = type,
TenantId = tostring(customDimensions.TenantId)
| summarize ExceptionCount = count() by ExceptionType, TenantId
| order by ExceptionCount desc
Description
Summarizes the total number of exceptions by both exception type and tenant ID within the selected time range. This helps identify the most frequent exception types and the tenants impacted, making it easier to prioritize troubleshooting efforts.
Chart Example:

📊 Count of Exceptions by Request Path / Async Job Name and Tenant in the Given Time Range
1️⃣ Exception Counts by API/Async Job Request Path and Tenant
Title: Exception Counts by API/Async Job Request Path and Tenant
Query
exceptions
| where isnotempty(customDimensions.TenantId)
and isnotempty(customDimensions.requestPath)
| extend
RequestPath = strcat(tostring(customDimensions.requestMethod), ":", tostring(customDimensions.requestPath)),
TenantId = tostring(customDimensions.TenantId)
| summarize ExceptionCount = count()
by RequestPath, TenantId
| order by RequestPath asc, TenantId asc
| render columnchart
Description
Displays total exception counts grouped by both the API or Async Job request path and TenantId. It captures how many exceptions occurred for each unique combination of request path and tenant within the selected time range. The chart sorts results alphabetically by request path and tenant ID.
Chart Example:
