[ECS][Agent]: publish ECS Agent Status Metrics to CloudWatch Metrics
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment
**Tell us about your request**
I would like ECS Agent Connected status published to CloudWatch Metrics.
**Which service(s) is this request for?**
ECS with EC2.
**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
The typical use case would be to alert on systems where the ECS Agent on a given Container Instance has been disconnected for a period of time and to respond to this event (either through a manual or automated means). This is difficult because:
- utilizing "event based" monitoring/alerting is difficult because the agent connects/disconnects "several times per house during normal operations" (in other words, if you alert on each disconnect that will be an issue)
- the telemetry data we would like to utilize is not available
Currently:
**Are you currently working around this issue?**
- I have written a lambda function (about 40 lines of code) that publishes a metric to a monitoring service to allow alerting (this isn't CloudWatch but _could_ be)
**Additional context**
- I _believe_ very few customers know agent disconnects are an issue or they encounter the issue infrequently enough they accept the increase cost resulting from running disconnected Container Instances
- AWS has published (Monitoring the Amazon ECS Agent)[https://aws.amazon.com/blogs/containers/monitoring-the-amazon-ecs-agent/] which provides evidence that AWS _is_ aware of an issue ("Platform operators often look for guidance on how to monitor the availability of the ECS Agent, and therefore the ECS Container Instance, by ensuring the failure relevant alerts are in place"). There are reasons why an ECS customer would not want this solution:
- an expectation that this (monitoring agent status) is an important feature of the ECS platform and should be provided/built-in
- perception of lack of adoption (in 2+ years this repository has three stars and three forks) and almost no public Internet links
- complexity: the resource count: 11 and the variety of different resource types places a cognitive load/knowledge requirements on the user/implementer where a more simply CloudWatch Metric and Alert could accomplish the similar task easily
- the status (it's in "aws-samples" implying it isn't fully supported)
**Attachments**
I would, happily, provide a link to the lambda solution I've written to demonstrate both:
1. How I believe the metrics _should_ be produced (essentially, I copied the EC2 Instance Status metrics)
2. Provide a jumping off point for discussions about how to implement this
Contributor guide
Assessment
This issue has not been assessed yet.