Soru

Zorluk: OrtaQuery and Analyze Application Insights Telemetry

An Azure App Service web application experiences intermittent failures. You are troubleshooting the issues by querying Application Insights telemetry.

You need to correlate the exceptions recorded over the last 2424 hours with their associated failed requests to identify the most common problem IDs.

Which KQL query should you execute to retrieve this data with the best query performance?

  1. A
    exceptions
    | where timestamp > ago(24h)
    | join kind=inner (
    requests
    | where success == false
    ) on operation_Id
    | summarize OccurrenceCount = count() by problemId
    | top 5 by OccurrenceCount desc
  2. B
    exceptions
    | join kind=inner (
    requests
    | where success == false
    ) on operation_Id
    | summarize OccurrenceCount = count() by problemId
    | top 5 by OccurrenceCount desc
  3. exceptions
    | where timestamp > ago(24h)
    | join kind=inner (
    requests
    | where timestamp > ago(24h)
    | where success == false
    ) on operation_Id
    | summarize OccurrenceCount = count() by problemId
    | top 5 by OccurrenceCount desc
    Cevap
  4. D
    exceptions
    | join kind=inner (
    requests
    | where success == false
    ) on operation_Id
    | where timestamp > ago(24h)
    | summarize OccurrenceCount = count() by problemId
    | top 5 by OccurrenceCount desc

Cevap

The correct query applies the 'where timestamp > ago(24h)' filter to both the exceptions and the requests tables before performing the inner join.
The correct query applies the time filter to both the exceptions table and the requests subquery before executing the join. In Kusto Query Language (KQL), filtering tables by time range as early as possible—especially on both sides of a join—minimizes the dataset size processed in memory, yielding the best query execution performance.

Adım Adım Çözüm

1
Filter both input tables by timestamp
Limits the scope of data retrieved from both the exceptions and requests tables to the last 24 hours.
Applying time-range filters early on both sides of a join prevents the query engine from scanning historical telemetry, optimizing execution speed.
2
Perform the inner join on operation_Id
Correlates only the relevant 24-hour records between the two tables.
Using operation_Id matches the exceptions to their corresponding failed requests.
3
Summarize and retrieve the top results
Groups the matched exceptions by problemId, counts the occurrences, and returns the top 5.
This answers the diagnostic requirement to find the most common problem IDs.

Anahtar Kavram

Best practices for KQL query optimization when joining high-volume telemetry tables in Application Insights.
Bu soruyu puanla