我通过 App Insights 中的异常的 issueId 对这个查询进行了计数:
// exception count by problem ID
let start=datetime("2018-01-09T14:17:00.000Z");
let end=datetime("2018-01-10T14:17:00.000Z");
let timeGrain=5m;
let dataset=exceptions
// additional filters can be applied here
| where timestamp >= ago(24h)
| where client_Type == "PC" ;
dataset
| project problemId, cloud_RoleName, itemCount, details
| summarize count_=sum(itemCount) by problemId, cloud_RoleName, stacktrace_ = (tostring(details))
// calculate exception count for all exceptions
| union(dataset
| summarize count_=sum(itemCount)
| extend problemId="Overall")
| order by count_ desc
我还想包括堆栈跟踪,但我只想获取一组“问题 ID”的第一个“详细信息”列。有任何想法吗?谢谢