When it comes to wastage in EC2 instances, Stax can retrieve metrics from CloudWatch to track an instance's memory utilization.
You can either use the AWS CloudWatch Agent to collect these metrics or setup custom metrics. The recommended approach is to utilize the CloudWatch Agent as it integrates with AWS Systems Manager for unified metrics and logs collection, improving the overall observability of your EC2 Instances.
If you do choose to use Custom CloudWatch metrics, rather than the above agent, you’ll need to set up one of the following CloudWatch metrics:
For any instance type:
- Memory/MemFreeBytes + Memory/MemTotalBytes
- Windows/Default/Available Mbytes
- System/Windows/Available Mbytes
- Windows/Default/Available Memory
- System/Windows/Available Memory
You can find more information about how to setup these metrics in the references below.