You are troubleshooting performance issues in an Azure web application. You need to write a Kusto Query Language (KQL) query in Application Insights to analyze external dependency calls.
The query must meet the following requirements:
- Retrieve data logged in the last hours.
- Identify dependency calls that took longer than seconds to complete.
- Group the results by the target and type of the dependency.
- Calculate the percentile of the duration for each group.
- Execute with optimal performance and minimize the volume of scanned telemetry data.
Which two of the following KQL queries should you use to satisfy these requirements?
- dependencies
| where timestamp > ago(12h)
| where duration > 2000
| summarize percentiles(duration, 90) by target, typeCevap - dependencies
| where timestamp > ago(12h) and duration > 2000
| summarize percentiles(duration, 90) by target, typeCevap - Cdependencies
| where duration > 2000
| summarize percentiles(duration, 90) by target, type - Ddependencies
| where duration > 2000
| summarize percentiles(duration, 90) by target, type
| where timestamp > ago(12h) - Edependencies
| where timestamp > ago(12h)
| where duration > 2
| summarize percentiles(duration, 90) by target, type
Cevap
The correct queries are the ones that filter by the timestamp within the last hours early in the pipeline, use milliseconds as the duration threshold, and calculate the percentile grouped by target and type.
The correct options filter the dataset by time range (`timestamp > ago(12h)`) and dependency duration (`duration > 2000`) before running the summarization function. In KQL, applying filtering early reduces the dataset size for down-pipeline operations, which satisfies the optimization requirement. In Application Insights telemetry, the dependency duration is measured in milliseconds, so a filter value of `2000` is required to match seconds.
Adım Adım Çözüm
Anahtar Kavram
Optimizing Application Insights KQL queries by utilizing early time-range filtering and performing correct unit conversions on telemetry metrics.