Azure Log Analytics - 查询 Application Insight 自定义指标

标签 azure azure-application-insights azure-log-analytics

我有一个 Azure Application Insight 组件和一个单独的 Log Analytics 组件,用于从 App Insight 中提取数据。在 Log Analytics 门户内,使用 Log Analytics 查询语言(强力查询),我可以获得 Application Insight 跟踪和自定义事件。

过去 24 小时的自定义事件

自定义事件 |其中时间戳 >= 前(24 小时) |按时间戳 desc 排序

过去 24 小时的痕迹

痕迹 |其中时间戳 >= 前(24 小时) |按时间戳 desc 排序

但我无法读取我创建的自定义指标。我不是查询语言专家。有人可以告诉我,有办法查询吗?

最佳答案

如果自定义指标与事件/跟踪一起发送(例如 trackEvent(name, properties, metrics) ,它们将位于 customMeasurementscustomEvents 表的 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/

相关文章:

更新到 OMS 新查询语言后 Powershell Runbook 错误

postgresql - Azure PostgreSql 的性能很差

具有跨国复制的 Azure 托管实例故障转移

node.js - 部署到 Azure 应用服务的 Node 应用程序 : Error: The service is unavailable

azure - 请求遥测 - "durationMetric"?

azure - 如何在 Azure Log Analytics 工作区中获取 Windows 安全事件?

Azure Log Analytics - 警报建议

javascript - Azure 移动服务和 Ember.js

docker - dotnet 发布后在 docker 镜像中找不到 Application Insights 依赖项

c# - 更新经典桌面应用的 Application Insights 检测 key 的最佳实践