使用查询中设置的时间范围的Azure App Insights请求计数和响应

6rqinv9w  于 2023-03-19  发布在  其他
关注(0)|答案(1)|浏览(123)

尝试以以下格式从Azure应用程序Insights中提取查询中特定时间范围的请求计数和响应时间

let startDatetime = todatetime("2023-03-15 14:00:00.0");
let endDatetime = todatetime("2023-03-15 15:45:00.0");
requests
| summarize RequestsCount=sum(itemCount), AverageDuration=avg(duration), percentiles(duration, 50, 95, 99) by operation_Name 
| order by RequestsCount desc // order from highest to lower (descending)
| where timestamp > startDatetime and timestamp < endDatetime

运行查询时出现以下错误
'where' operator: Failed to resolve column or scalar expression named 'timestamp'

bvuwiixz

bvuwiixz1#

在对结果进行分组之前,需要使用where语句,因为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 // order from highest to lower (descending)

相关问题