Soru

Zorluk: ZorQuery and Analyze Application Insights Telemetry

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 1212 hours.
- Identify dependency calls that took longer than 22 seconds to complete.
- Group the results by the target and type of the dependency.
- Calculate the 90th90\text{th} 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?

  1. dependencies
    | where timestamp > ago(12h)
    | where duration > 2000
    | summarize percentiles(duration, 90) by target, type
    Cevap
  2. dependencies
    | where timestamp > ago(12h) and duration > 2000
    | summarize percentiles(duration, 90) by target, type
    Cevap
  3. C
    dependencies
    | where duration > 2000
    | summarize percentiles(duration, 90) by target, type
  4. D
    dependencies
    | where duration > 2000
    | summarize percentiles(duration, 90) by target, type
    | where timestamp > ago(12h)
  5. E
    dependencies
    | 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 1212 hours early in the pipeline, use 20002000 milliseconds as the duration threshold, and calculate the 90th90\text{th} 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 22 seconds.

Adım Adım Çözüm

1
Determine the telemetry source table and filter for the target time window.
Query the `dependencies` table and apply `where timestamp > ago(12h)` at the start of the query pipeline.
Applying the time filter first minimizes the partition scanning and optimizes overall query performance.
2
Convert the duration requirement into milliseconds and apply the filter.
Apply a filter of `where duration > 2000`.
The `duration` column in the Application Insights `dependencies` table is measured in milliseconds, meaning 22 seconds is equivalent to 20002000 milliseconds.
3
Group and calculate the required percentile.
Use `summarize percentiles(duration, 90) by target, type`.
The `percentiles()` aggregation calculates the specified percentile (in this case, the 90th90\text{th} percentile) for each unique combination of the grouping columns.

Anahtar Kavram

Optimizing Application Insights KQL queries by utilizing early time-range filtering and performing correct unit conversions on telemetry metrics.
Bu soruyu puanla