您如何提醒 Alexa 技能的错误和警告?
How do you alert on errors and warnings for an Alexa skill?
我正在尝试为连接到 Alexa 技能的 AWS Lambda 函数 (node.js 8.10) 设置日志记录。我注意到 CloudWatch 可以轻松 alert on errors or route to alternate processing queues in the case where the lambda returns a proper error response, and you can use metric filters to automate searching through log files 并针对不同的文本发出警报。
我注意到我的堆栈的两个属性使用这个变得复杂:
- CloudWatch 似乎不区分 node.js 日志记录级别或 stderr/stdout,这使警告和错误的一般警报变得复杂。
- 我们通常会 return 具有成功响应代码的格式良好的 Alexa 响应,即使在内部故障的情况下也是如此,因为我们希望 Alexa 以特定响应而不是一般 "I ran into an error" 响应来响应.
考虑到这一点,我的问题是:
- 其他人如何管理您的 Alexa 技能中的非致命错误的日志记录和警报?
- 在 CloudWatch 中将我当前的日志记录转换成更多内容的好方法是什么 "alertable"?
- 我刚才是不是想错了?我应该以不同的方式处理这个吗?或者我应该高兴我可以获得致命的异常警报而不用担心日志的警报?
我们最终将 Winston 添加到我们的 Lambda 中,并使用它为我们的日志提供可解析的格式。
从那里,我们设置了一个 CloudWatch 指标过滤器来寻找以下模式:
[logLevel="error:", ...]
然后在匹配的情况下将标志设置为 1。
然后,我们设置了一个 CloudWatch 警报,以在设置标志时触发发送到 SNS 主题的电子邮件。我们没有在生成的电子邮件中获得具体的日志,但我们有足够的信息来登录和检查日志。
我正在尝试为连接到 Alexa 技能的 AWS Lambda 函数 (node.js 8.10) 设置日志记录。我注意到 CloudWatch 可以轻松 alert on errors or route to alternate processing queues in the case where the lambda returns a proper error response, and you can use metric filters to automate searching through log files 并针对不同的文本发出警报。
我注意到我的堆栈的两个属性使用这个变得复杂:
- CloudWatch 似乎不区分 node.js 日志记录级别或 stderr/stdout,这使警告和错误的一般警报变得复杂。
- 我们通常会 return 具有成功响应代码的格式良好的 Alexa 响应,即使在内部故障的情况下也是如此,因为我们希望 Alexa 以特定响应而不是一般 "I ran into an error" 响应来响应.
考虑到这一点,我的问题是:
- 其他人如何管理您的 Alexa 技能中的非致命错误的日志记录和警报?
- 在 CloudWatch 中将我当前的日志记录转换成更多内容的好方法是什么 "alertable"?
- 我刚才是不是想错了?我应该以不同的方式处理这个吗?或者我应该高兴我可以获得致命的异常警报而不用担心日志的警报?
我们最终将 Winston 添加到我们的 Lambda 中,并使用它为我们的日志提供可解析的格式。
从那里,我们设置了一个 CloudWatch 指标过滤器来寻找以下模式:
[logLevel="error:", ...]
然后在匹配的情况下将标志设置为 1。
然后,我们设置了一个 CloudWatch 警报,以在设置标志时触发发送到 SNS 主题的电子邮件。我们没有在生成的电子邮件中获得具体的日志,但我们有足够的信息来登录和检查日志。