我当前正在尝试将错误记录到Google Container Engine的堆叠式驱动器错误报告。我正在使用GKE的内置基于Fluentd的堆叠式伐木剂,它效果很好。但是,当我根据规范记录错误(https://cloud.google.com/error-reporting/docs/formatting-error-messages(,我看不到它在Stackdriver错误报告中显示
我在stackdriver记录中看到的有效载荷是
{
insertId: "xatjb4fltv246"
jsonPayload: {
stream: "event"
message: "path was incorrect"
environment: "production"
event_type: "RAILS_ERROR"
context: {
path: "/2",
reportLocation: {
functionName: "foo"
filePath: "/something.js"
lineNumber: 3
}
request_id: "3149e5c4-3192-4a9c-a123-b4dedf5a9e07"
}
timestamp: 1492205840
serviceContext: {
service: "nambrotdotcom"
}
}
resource: {…}
timestamp: "2017-04-14T21:37:20Z"
severity: "INFO"
labels: {…}
logName: "projects/nambrotdotcom/logs/web"
}
如果我正确理解,这应该没问题?
编辑:
我根据"故障拍摄"页面记录了手动错误,并且效果很好。我在手动记录的错误和从GKE登录的有效载荷之间看到的唯一区别是日志名称和标签是不同的,但这不是一个因素?
错误报告正在寻找严重性ERROR
或更高,但在大多数情况下也会考虑DEFAULT
。问题是 severity: "INFO"
日志条目中的值。