You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Application Insights:如何在同一时间图中展示成功与失败事务

修改Kusto查询同时展示成功/失败事务时间图

你可以调整查询逻辑,同时统计成功与失败的事务数量,让时间图展示两条对比曲线。修改后的查询如下:

customEvents
    | extend TimeStamp = timestamp, IsSuccessful = customDimensions["Is Successful"]
    | where name contains 'Transaction Posted' and customDimensions['Transaction Number'] != ''
    | where IsSuccessful in ("True", "False")
    | make-series 
        FailedTransactions=countif(IsSuccessful == "False"),
        SuccessfulTransactions=countif(IsSuccessful == "True")
        on TimeStamp from (startofday(now()) - 7days) to now() step 1d
    | project-reorder TimeStamp, FailedTransactions, SuccessfulTransactions
    | render timechart

关键调整说明:

  • 新增IsSuccessful字段,简化后续对事务状态的引用
  • 移除原查询中仅过滤失败事务的条件,改为保留所有有效成功/失败状态的记录
  • 用countif()在make-series中分别统计两类事务的数量,生成两个独立的时间序列
  • 调整project-reorder包含两个统计列,渲染时会自动在时间图中生成对应曲线,直观展示成功与失败的趋势对比

内容的提问来源于stack exchange,提问作者Bhav

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 04:22:08