我正在编写一个查询,该查询使用百分位秩聚合来获取在特定时间内所用的所有请求的百分比。如果此百分比低于某个阈值,则将通过slack发送警报。
{"payload": {
"_shards": {...},
"hits": {...},
"aggregations": {
"p95_duration": {
"values": {
"200.0": 92.16255318427162
}
}
}
}
}
但是,当slack操作执行时 {{ctx.payload.aggregations.p95_duration.values["200.0"]}}
部分似乎无效,因为标题显示为 Alert: of requests are under 200ms.
我什么都试过了:
{{ctx.payload.aggregations.p95_duration.values[\"200.0\"]}}
=> Alert: of requests are under 200ms.
{{ctx.payload.aggregations.p95_duration.values.get("200.0")}}
=> Alert: of requests are under 200ms.
{{ctx.payload.aggregations.p95_duration.values}}
=> Alert: {200.0=92.16255318427162} of requests are under 200ms.
从上一个可以看出,在开始引用Map中的数字键之前,一切正常。所以我的问题是,如何让它引用密钥的值,即:
Alert: 92.16255318427162% of requests are under 200ms.
暂无答案!
目前还没有任何答案,快来回答吧!