We have a setup with AWS ECS task scheduled with CloudWatch Events / EventBridge. We'd like to have metrics & notification for failed runs based on container exit code.
We were planning to use FailedInvocations from Monitoring Usage with CloudWatch Metrics.
However, it seems that non-zero task exit code isn't seen in the metrics. The exit code for the ECS task is verified to be non-zero in AWS console but the metrics include only "Invocations" & "TriggeredRules". We had FailedInvocations earlier when setting up the task and missing policies required to start the task but non-zero exit code doesn't seem to effect that metric.
Is it just that EventBridge doesn't provide metrics for a non-zero container exit code or could we miss something in our setup?
We can work this around with the task logging certain error message but exit code would be more general.