You are investigating a brief spike in application errors that occurred within the last hour. You need to write a Kusto Query Language (KQL) query in Azure Application Insights to retrieve all recorded exceptions from the `exceptions` table. The query must be optimized to run quickly and avoid scanning historical data beyond the necessary timeframe.
Which KQL query should you use?
- Aexceptions
- Bexceptions
| where timestamp == ago(1h) - exceptions
| where timestamp > ago(1h)Answer - Dexceptions
| where severityLevel > 3
Answer
The query that filters the exceptions table where the timestamp is greater than ago(1h).
The query that filters the exceptions table where the timestamp is greater than ago(1h) is correct because it uses the timestamp field to limit the data scan to the specified one-hour window. This is highly performant and conforms to Azure Monitor best practices.
Step-by-Step Solution
Key Concept
Optimizing KQL queries in Azure Monitor/Application Insights by filtering on the timestamp column first to restrict the data scan volume.