Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

feat: Log Step Function State Machine events #2300

Merged
merged 2 commits into from
Nov 14, 2022
Merged

Conversation

Jimlinz
Copy link
Contributor

@Jimlinz Jimlinz commented Nov 14, 2022

We should probably be logging Step Function State Machine events to CloudWatch. This would help with troubleshooting.
This complies with AwsSolutions-SF1.

Example log snippet:

{
    "id": "4",
    "type": "LambdaFunctionStarted",
    "details": {},
    "previous_event_id": "3",
    "event_timestamp": "1668385713883",
    "execution_arn": "arn:aws:states:ap-southeast-2:12345:execution:processinggeostoredatasetversioncreation65D71092-W9Bi3T8DiGui:2022-11-14T00-28-33-438Z_59Z1PGC394K1FR4H"
}

{
    "id": "5",
    "type": "LambdaFunctionFailed",
    "details": {
        "cause": "{\"errorMessage\": \"\", \"errorType\": \"InvalidSTACRootTypeError\", \"requestId\": \"ef0b96d2-560b-44fc-9b67-b69f4800b735\", \"stackTrace\": [\"  File \\\"/var/task/geostore/check_stac_metadata/task.py\\\", line 102, in lambda_handler\\n    validator.run(event[METADATA_URL_KEY])\\n\", \"  File \\\"/var/task/geostore/check_stac_metadata/utils.py\\\", line 155, in run\\n    raise InvalidSTACRootTypeError()\\n\"]}",
        "error": "InvalidSTACRootTypeError"
    },
    "previous_event_id": "4",
    "event_timestamp": "1668385717164",
    "execution_arn": "arn:aws:states:ap-southeast-2:12345:execution:processinggeostoredatasetversioncreation65D71092-W9Bi3T8DiGui:2022-11-14T00-28-33-438Z_59Z1PGC394K1FR4H"
}

@Jimlinz Jimlinz marked this pull request as draft November 14, 2022 01:58
@Jimlinz Jimlinz marked this pull request as ready for review November 14, 2022 02:10
@kodiakhq kodiakhq bot merged commit f09cf61 into master Nov 14, 2022
@kodiakhq kodiakhq bot deleted the statemachine_logging branch November 14, 2022 02:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

2 participants