将异常消息从步进功能发送到AWS CloudWatch事件日志

问题描述 投票:0回答:1

[AWS Step-function失败时,输出消息为null,并且输出消息传递到cloudwatch事件日志,但异常错误消息不会传递到cloudwatch事件日志。如何将异常消息发送到cloudwatch事件日志,以便可以在下游处理它。

amazon-cloudwatch aws-step-functions amazon-cloudwatchlogs
1个回答
0
投票

CloudWatch EventsCloudWatch Logs是两种不同的服务。如果在ERRORFATALALL日志级别启用日志记录,您将在CloudWatch Logs中看到错误。参见https://docs.aws.amazon.com/step-functions/latest/dg/cw-logs.html

我假设您在这里指的是CloudWatch Events / EventBridge。 The events Step Functions emits to CloudWatch Events包含DescribeExecution API的结果。它不包括错误,仅包括执行的输入和输出。导致执行失败的错误和原因位于执行历史记录中的最后一个事件的executionFailedEventDetails字段中。您可以通过使用GetExecutionHistory"reverseOrder": true调用"maxResults": 1来检索上一个事件。

© www.soinside.com 2019 - 2024. All rights reserved.