AppRequests テーブルのクエリ

応答時間の傾向

過去 12 時間の要求期間をグラフで示します。

// To create an alert for this query, click '+ New alert rule'
AppRequests
| where TimeGenerated > ago(12h) 
| summarize avgRequestDuration=avg(DurationMs) by bin(TimeGenerated, 10m), _ResourceId // use a time grain of 10 minutes
| render timechart

要求数の傾向

グラフ要求は、最後の日にカウントされます。

// To create an alert for this query, click '+ New alert rule'
AppRequests
| summarize totalCount=sum(ItemCount) by bin(TimeGenerated, 30m), _ResourceId
| render timechart

応答時間バケット

各パフォーマンス バケット内の要求の数を表示します。

AppRequests
| summarize requestCount=sum(ItemCount), avgDuration=avg(DurationMs) by PerformanceBucket
| order by avgDuration asc // sort by average request duration
| project-away avgDuration // no need to display avgDuration, we used it only for sorting results
| render barchart

操作のパフォーマンス

要求数と期間を操作別に計算します。

// To create an alert for this query, click '+ New alert rule'
AppRequests
| summarize RequestsCount=sum(ItemCount), AverageDuration=avg(DurationMs), percentiles(DurationMs, 50, 95, 99) by OperationName, _ResourceId // you can replace 'OperationName' with another value to segment by a different property
| order by RequestsCount desc // order from highest to lower (descending)

トラフィック別の上位 10 か国

上位 10 か国からの要求の量をグラフ化します。

AppRequests
| summarize CountByCountry=count() by ClientCountryOrRegion
| top 10 by CountByCountry
| render piechart

失敗した要求 - 上位 10 件

最も遅い 3 ページとは何ですか。また、どの程度遅いですか?

AppRequests
| where Success == false
| summarize failedCount=sum(ItemCount) by Name
| top 10 by failedCount desc
| render barchart

失敗した操作

操作が失敗した回数と、影響を受けたユーザーの数を計算します。

// To create an alert for this query, click '+ New alert rule'
AppRequests
| where Success == false
| summarize failedCount=sum(ItemCount), impactedUsers=dcount(UserId) by OperationName, _ResourceId
| order by failedCount desc

要求エラーの原因となっている例外

過去 1 時間に失敗した要求の原因となった例外を見つけます。

AppRequests
| where TimeGenerated > ago(1h) and Success == false
| join kind= inner (
AppExceptions
| where TimeGenerated > ago(1h)
) on OperationId
| project exceptionType = Type, failedMethod = Method, requestName = Name, requestDuration = DurationMs, _ResourceId