Azure Monitor (Application Insights) 日志查询图表 - Y 轴上的内容是什么?

Azure Monitor (Application Insights) log queries charts - what is on Y-axis?

如何选择 Application Insights(Azure Monitor?)图表中 Y 轴上显示的内容?

我在 Application Insights 中有自定义事件,我想使用自定义指标构建时间序列图表。

但是 Y 轴上显示的不是我的指标,而是 itemCount。如何选择 Y 轴指标?

获得正确 time-series 图表的关键是从查询的结果集中获取所有时间和指标信息。

requests table 为例(您可以根据需要将其应用于您的 customEvents 数据):

# Simple time-series chart
requests
| summarize Requests = count() by bin(timestamp, 1h)
| render timechart

输出: 在这里,查询控件对 X-axis 使用时间戳,对 Y-axis.

使用请求

接下来,多个指标也可以绘制为:

# Time-series chart with multiple metrics
requests
| summarize Requests = count(), Users = dcount(user_Id) by bin(timestamp, 1h)
| render timechart

输出: 查询控件在 X-axis 中使用时间戳,在 Y-axis 中使用 Requests & Users 作为单独的系列。

还有 make-series 运算符,它可以选择为空桶提供默认值。

requests
| where name contains "POST"
| make-series Requests = count() default = 0 on timestamp from ago(1d) to now() step 1h by RequestName = name
| render timechart

输出:

如需补充阅读,请参阅以下资源: