Tracking your AWS Step Function

How can we track our AWS Step Function? There doesn't seem to be a direct way when we try to search on the AWS console.

We can add an SNS Publish state inside the flow itself. We have to add error catch block on each state (pointing to the Publish state). That is too much work when still suffering from Monday Blues.

So, is there a simple way to create a notification for step function failure/success? Well, if you have an event driven mind, I imagine you screaming 'Cloud Watch Rules' and you will be right.


There is a rule to track the execution state change for a step function. Specifically, the search for 'Step Functions Execution Status Change' event type and the rest is pretty intuitive.

We can select the Step Function State Machine we want to track, which state changes (Success, Failure, Aborted etc.) we want to trigger the events on.

And of course we can choose SNS as target.

For example, here is a sample event definition for tracking success/failure state change.

{
  "source": ["aws.states"],
  "detail-type": ["Step Functions Execution Status Change"],
  "detail": {
    "status": ["FAILED", "SUCCEEDED"],
    "stateMachineArn": ["arn:aws:states:us-east-1:99******99:stateMachine:my-state-machine"]
  }
}        

And, here is a screenshot of the AWS console while defining the rule:


Hope this will help you in making your processes more robust and easier to monitor.

#genpact #aws #dataengineering #cloud #microservices




要查看或添加评论,请登录

Piyush Gupta的更多文章

  • PySpark - Melting that Json

    PySpark - Melting that Json

    Json can be a really pesky format to work on when creating distributed jobs. The problem is, of course, there is no…

  • Converting Json Keys to Columns in PySpark

    Converting Json Keys to Columns in PySpark

    JSON is a great format for message passing between applications, but not so great when we need to create a table from…

  • Wrapping/Folding text in Python

    Wrapping/Folding text in Python

    You know what really infuriates me after deploying the complete pipeline? The target system (like Open search)…

社区洞察

其他会员也浏览了