elastic watcher 输出 error.exception

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}}

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容