AppRequests 數據表的查詢
如需在 Azure 入口網站 中使用這些查詢的詳細資訊,請參閱Log Analytics教學課程。 如需 REST API,請參閱 查詢。
回應時間趨勢
繪製過去 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