Posted On: Dec 8, 2022
EC2 Auto Scaling customers can now use Amazon CloudWatch Metric Math to customize the metrics they use with Target Tracking policy without actually having to publish and pay for customized metrics. Customers can use both arithmetic operators (such as +, -, /, and *) and mathematical functions (such as Sum and Average) to easily create custom metrics based on existing CloudWatch metrics. Target Tracking, like other EC2 Auto Scaling policies, helps customers maintain high availability while reducing costs by auto scaling their environments to meet changing demand. Specifically, Target Tracking works like a thermostat: it constantly changes the capacity of an Auto Scaling group to maintain the specified metric at a customer-defined target level. Today’s release makes it easier and cheaper to configure Target Tracking with custom metrics.
Target Tracking offers out-of-the-box support for the most common infrastructure metrics such as CPU Utilization. In some cases, customers want to scale on their own application-specific metrics, such as the number of request served, or on metrics published by other AWS services , such as AWS SQS. Until today, you would have to create custom CloudWatch metrics for Target Tracking to consume. Now, if the custom metric is a simple function of other existing metrics, you can use CloudWatch Metric Math in the Target Tracking policy, instead of publishing (and paying for) a new custom CloudWatch metric. For example, to define a custom metric representing the SQS messages per instance, you could take the existing SQS metric for queue length (ApproximateNumberOfMessages) and simply divide it by the number of instances in the Target Tracking Policy using Metric Math to make it work with your Target Tracking policy.