'Collect file descriptors in ECS tasks to send to Cloudwatch

I'm currently running into a problem with our application where the we have too many files opened and it's causing a errors. I've increased the ulimit for NOFILE in the task definition and I'm making code changes but I need to be able to monitor the open files for individual containers to make sure the code changes are working.

Is there way to simply configure the cloudwatch-agent or the like to send the metrics to cloudwatch?

The only other idea I got is to create a bash script that logs into individual containers to collect the data and send up to cloudwatch.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source