有关在 Azure 门户中使用这些查询的信息,请参阅 Log Analytics 教程。 有关 REST API,请参阅 查询。
异常事件摘要
按过去 24 小时内的类型和服务汇总异常事件。
OTelEvents
| where TimeGenerated > ago(24h)
| where isnotempty(ExceptionType)
| summarize
ExceptionCount = count(),
UniqueTraces = dcount(TraceId),
UniqueSpans = dcount(SpanId),
SampleMessages = take_any(ExceptionMessage, 3)
by ServiceName, ExceptionType, ExceptionProblem
| order by ExceptionCount desc
| project ServiceName, ExceptionType, ExceptionProblem, ExceptionCount, UniqueTraces, UniqueSpans, SampleMessages
| limit 100