A development team is troubleshooting intermittent database connectivity errors in an Azure Web App. You need to write a Kusto Query Language (KQL) query in Application Insights to correlate failed dependency calls with exceptions. The query must return the target of the failed dependency, the associated exception details, and the operation ID. To prevent query timeouts on high-volume production logs, the query must be optimized to scan the minimum amount of data possible within the last 24 hours.
Which KQL query should you use?
- dependencies
| where timestamp > ago(24h) and success == false
| join kind=inner (
exceptions
| where timestamp > ago(24h)
) on operation_Id
| project timestamp, operation_Id, target, outerMessageCevap - Bdependencies
| join kind=inner (
exceptions
) on operation_Id
| where timestamp > ago(24h) and success == false
| project timestamp, operation_Id, target, outerMessage - Cdependencies
| where timestamp > ago(24h) and success == false
| join kind=inner (exceptions) on operation_Id
| project timestamp, operation_Id, target, outerMessage - Ddependencies
| where success == false
| join kind=inner (
exceptions
) on operation_Id
| project timestamp, operation_Id, target, outerMessage
Cevap
The query that filters both the dependencies and exceptions tables by the 24-hour time range before joining them on the operation ID.
The correct query applies the 24-hour time filter to both the dependencies table and the exceptions subquery. In Kusto, telemetry tables are partitioned by timestamp. Applying the time filter to both datasets before performing the join ensures that partition pruning is applied on both tables, drastically reducing the data scanned during the join and preventing query timeouts.
Adım Adım Çözüm
Anahtar Kavram
Partition pruning and early time-range filtering in KQL joins