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

Azure App Insights查询请求计数与响应时间遇timestamp字段解析错误

问题解决:Kusto查询中'timestamp'列无法解析的错误

错误原因

你把时间过滤的where语句放在了summarize之后,但summarize操作会根据operation_Name聚合数据,聚合后的结果集里已经不存在timestamp列了,所以查询会报错找不到该列。正确的逻辑应该是先过滤时间范围,再进行聚合统计。

修正后的查询语句

let startDatetime = todatetime("2023-03-15 14:00:00.0");
let endDatetime = todatetime("2023-03-15 15:45:00.0");
requests
| where timestamp > startDatetime and timestamp < endDatetime // 先过滤目标时间范围的原始数据
| summarize RequestsCount=sum(itemCount), 
            AverageDuration=avg(duration), 
            percentiles(duration, 50, 95, 99) 
            by operation_Name 
| order by RequestsCount desc // 按请求数从高到低排序

逻辑说明

  • 先通过where筛选出指定时段的原始请求数据,确保后续聚合的是目标时间范围内的有效数据
  • summarize操作会按接口名称(operation_Name)分组,计算每组的请求总数、平均响应时间,以及响应时间的50/95/99分位数
  • 最后按请求总数降序排列结果,方便快速查看访问量最高的接口

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.27 14:44:55