gpt4 book ai didi

azure - 对于指标警报类型,搜索查询应包含 'AggregatedValue' 和 'bin(timestamp, [roundTo])'

转载 作者:行者123 更新时间:2023-12-04 11:05:49 25 4
gpt4 key购买 nike

我正在尝试根据 Application Insights 日志中的某些指标创建自定义指标警报。下面是我正在使用的查询;

let start = customEvents
| where customDimensions.configName == "configName"
| where name == "name"
| extend timestamp, correlationId = tostring(customDimensions.correlationId), configName = tostring(customDimensions.configName);

let ending = customEvents
| where customDimensions.configName == configName"
| where name == "anotherName"
| where customDimensions.taskName == "taskName"
| extend timestamp, correlationId = tostring(customDimensions.correlationId), configName = tostring(customDimensions.configName), name= name, nameTimeStamp= timestamp ;


let timeDiffs = start
| join (ending) on correlationId
| extend timeDiff = nameTimeStamp- timestamp
| project timeDiff, timestamp, nameTimeStamp, name, anotherName, correlationId;

timeDiffs
| summarize AggregatedValue=avg(timeDiff) by bin(timestamp, 1m)

当我在“分析”页面中运行此查询时,我得到了结果,但是当我尝试创建自定义指标警报时,出现错误 搜索查询应包含“AggregateValue”和“bin(timestamp, [roundTo]” )' 用于指标警报类型

我发现的唯一响应是添加我已有的 AggregateValue,我不确定为什么自定义指标警报页面会出现此错误。

最佳答案

我发现我的查询出了什么问题。本质上,聚合值需要是数字,但是 AggregateValue=avg(timeDiff) 生成时间值,但以秒为单位,因此有点难以注意到。将其转换为int即可解决问题,

我刚刚更新了最后一点,如下

timeDiffs
| summarize AggregatedValue=toint(avg(timeDiff)/time(1ms)) by bin(timestamp, 5m)

这给创建警报时的 Aggregate On 带来了另一个挑战,因为 AggregateValue 不属于 by 语句之后的分组的一部分。

关于azure - 对于指标警报类型,搜索查询应包含 'AggregatedValue' 和 'bin(timestamp, [roundTo])',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52365346/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com