【问题标题】:Using extend to add a count column in Azure Stream Analytics/Application Insights在 Azure 流分析/Application Insights 中使用扩展添加计数列
【发布时间】:2017-02-28 04:03:24
【问题描述】:

我有一个如下所示的 Application Insights Azure 流分析查询...

requests
| summarize count() by bin(duration, 1000)
| order by duration asc nulls last

...这给了我类似这样的信息,它显示了 Application Insights 中记录的按持续时间分类的请求数量(以秒为单位)。

| 0    | 1000 |
| 1000 | 500  |
| 2000 | 200  |

我希望能够添加另一列,显示每个 bin 中所有请求的异常计数。

我知道extend 用于添加其他列,但要这样做,我必须引用“外部”表达式来获取 bin 约束,我不知道该怎么做。这是最好的方法吗?还是我最好尝试join 两个表一起然后做summarize

谢谢

【问题讨论】:

    标签: azure-application-insights ms-app-analytics


    【解决方案1】:

    正如您所怀疑的那样 - extend 在这里对您没有多大帮助。您需要在操作 ID 上运行join kind=leftouter(需要leftouter,这样您就不会丢弃没有任何异常的请求):

    requests
    | join kind=leftouter (
        exceptions
        | summarize exceptionsCount = count() by operation_Id
    ) on operation_Id
    | summarize count(), sum(exceptionsCount) by bin(duration, 1000)
    | order by duration asc nulls last
    

    【讨论】:

    • 太棒了。谢谢!
    猜你喜欢
    • 2017-06-13
    • 1970-01-01
    • 1970-01-01
    • 2018-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多