An Azure App Service web application is experiencing latency issues. You need to write an optimized Kusto Query Language (KQL) query in Application Insights to identify the top 5 slowest dependencies based on their average duration over the last 24 hours. The query must minimize the data scanned to ensure high performance.
Which KQL query should you run?
- dependencies
| where timestamp > ago(24h)
| summarize avg_duration = avg(duration) by target
| top 5 by avg_duration descCevap - Bdependencies
| summarize avg_duration = avg(duration) by target
| top 5 by avg_duration desc - Cdependencies
| where timestamp > ago(24h)
| where isnotempty(sdkVersion) and isnotempty(connectionString)
| summarize avg_duration = avg(duration) by target
| top 5 by avg_duration desc - Ddependencies
| where timestamp > ago(24h)
| where target has "cdn" and url has "cache=bypass"
| summarize avg_duration = avg(duration) by target
| top 5 by avg_duration desc
Cevap
The KQL query that filters the dependencies table by timestamp first, then calculates the average duration grouped by target, and finally selects the top 5 results sorted in descending order of average duration.
The correct query filters the `dependencies` table by `timestamp > ago(24h)` first to minimize data scanning, then groups by `target` using `summarize` to calculate the average `duration`, and uses the `top` operator to return the 5 slowest dependencies.
Adım Adım Çözüm
Anahtar Kavram
Optimizing Kusto Query Language (KQL) queries in Azure Application Insights by applying time-range filters early.
Tahmini Süre:1m 30s