Provide metrics for non-zero exit codes
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
This is more of an RFC, than a bug report. Please let me know if there is another mechanism that I should be using to submit a feature request :slightly_smiling_face:
### Summary
Currently, there is no easy way to monitor how many containers are exiting with non-zero [exit codes](https://github.com/aws/amazon-ecs-agent/blob/master/agent/sighandlers/exitcodes/exitcodes.go). We should provide a mechanism to (optionally) push the exit status code as a count metric to CloudWatch.
### Description
It is probably best if this is enabled via a [configuration option](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) in `/etc/ecs/ecs.config`, as cloudwatch metrics can be unnecessarily costly if you are not making use of them.
For me, it would be enough to just have a `ExitError` and `ExitSuccess` count, but others may prefer having separate metrics for each possible [exit code](https://github.com/aws/amazon-ecs-agent/blob/master/agent/sighandlers/exitcodes/exitcodes.go).
### Expected Behavior
Push metrics to CloudWatch.
### Observed Behavior
N/A
### Environment Details
Any [ECS-optimised AMI](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html)
### Supporting Log Snippets
N/A
Contributor guide
Research direction
Start with agent/sighandlers/exitcodes/exitcodes.go and the ECS agent configuration documentation for /etc/ecs/ecs.config. Review how exit statuses are observed and how CloudWatch metrics are currently configured, then determine the metric shape and configuration behavior needed for optional exit-status counts. Done means the chosen metrics can be enabled and pushed to CloudWatch as described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, go
- Domain
- cloud, observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100