Application Insights - 如何按自定义维度排序

Application Insights - How to sort by custom dimension

我想根据 customDimension.MyCustomProperty 对我的查询结果进行排序,它存在于所有实体中并且是一个数字。我该怎么做?

我的建议是首先 extend 使用您的 customDimension 处理您的结果集。然后,您必须将新列转换为字符串、整数或双精度数。原因是 customDimensions 被认为是动态列

一个简单的例子:

traces
| extend sortKey = toint(customDimensions.MyCustomProperty)
| order by sortKey asc

投射选项是:

  • tostring()
  • toint()
  • todouble()

如果要在实际排序后删除排序键,可以project-away新列。