1

statemachine logs for a specific execution can be easily queried in cloudwatch via the execution_arn field in the log events.

However how can i find out which logs/logstreams of the LAMBDA functions correspond to which statemachine execution? I haven't found any connection so far. Ideally i would have expected to find an execution_arn field also in the lambda logs when called from stepfunctions.

Julian Dm
  • 363
  • 2
  • 17

1 Answers1

1

There is no connection. You can, however, manually associate your Lambda logs with a State Machine execution by including the execution ARN in your input payload and logging it in Lambda. The execution ARN is available on the State Machine context object:

"Execution.$": "$$.Execution.Id"
fedonev
  • 20,327
  • 2
  • 25
  • 34
  • your proposal could work to create a custom logstream based on the execution arn via api. Will check it out, thank you – Julian Dm Mar 08 '22 at 12:49