美文网首页
elastic watcher 输出 error.excepti

elastic watcher 输出 error.excepti

作者: 偷油考拉 | 来源:发表于2024-06-02 16:44 被阅读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}}

相关文章

网友评论

      本文标题:elastic watcher 输出 error.excepti

      本文链接:https://www.haomeiwen.com/subject/uhdsqjtx.html