Azure Monitor(Application Insights)日志查询图表 - Y 轴上有什么?

Mik*_*nov 1 azure azure-monitoring azure-application-insights

如何选择 Application Insights(Azure Monitor?)图表中 Y 轴显示的内容? 在此输入图像描述

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

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

Bha*_*ara 6

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

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

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

输出: 简单的时间序列图 这里,查询控件使用时间戳作为 X 轴,使用请求作为 Y 轴。

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

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

输出: 绘制多个指标 查询控件在 X 轴上使用时间戳,在 Y 轴上使用请求和用户作为单独的系列。

还有一个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
Run Code Online (Sandbox Code Playgroud)

输出: make系列运算符

如需更多阅读,请参阅以下资源: