elastic watcher 输出 error.excepti

2024-06-02  本文已影响0人  偷油考拉

https://github.com/elastic/apm-server/pull/1825
https://github.com/elastic/kibana/issues/20664
https://github.com/elastic/kibana/issues/71025

一、关于 error.exception 是 array 的考证

image.png

根据官方开发人员的描述,为了支持 chained exception,目前是将 exception按照数组的格式存放的,从如上答复的时间来看,在2019年1月23日之前,这个数组只有一个对象。

或者,是不是可以理解为,如果没有使用 chained exception 的话,error.exception 数组只有 1个对象。

没有考证到 chained exception 多对象的更多信息。

二、怎么访问 error.exception 中的 message 和 type

部分内容提示可以用 error.exception[0].attributes 的方式访问。

在 watcher 中,我使用 {{ctx.payload._source.error.exception.0.message}} 的方式成功访问。

因为 {{ctx.payload._source.error.exception}} 显示为:
{0={message=Data truncation: Incorrect datetime value: 'null' for column 'TBgnTime' at row 1, type=com.mysql.jdbc.MysqlDataTruncation}}

上一篇 下一篇

猜你喜欢

热点阅读