我有一个 Azure Application Insight 组件和一个单独的 Log Analytics 组件,用于从 App Insight 中提取数据。在 Log Analytics 门户内,使用 Log Analytics 查询语言(强力查询),我可以获得 Application Insight 跟踪和自定义事件。
过去 24 小时的自定义事件
自定义事件 |其中时间戳 >= 前(24 小时) |按时间戳 desc 排序
过去 24 小时的痕迹
痕迹 |其中时间戳 >= 前(24 小时) |按时间戳 desc 排序
但我无法读取我创建的自定义指标。我不是查询语言专家。有人可以告诉我,有办法查询吗?
最佳答案
如果自定义指标与事件/跟踪一起发送(例如 trackEvent(name, properties, metrics)
,它们将位于 customMeasurements
或 customEvents
表的 traces
属性中。
customEvents | where timestamp >= ago(24h)
| project timestamp, name, customMeasurements
| order by timestamp desc
如果自定义指标作为其自己的“事件”通过 trackMetric(name, value, properties)
发送,然后您会查看 customMetrics
表
customMetrics | where timestamp >= ago(24h) | order by timestamp desc`
关于Azure Log Analytics - 查询 Application Insight 自定义指标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47938197/