CloudWatch adds 14 new Metric math functions
Amazon CloudWatch Metric Math now supports 14 new functions including RUNNING\_SUM, TIME\_SERIES, and DATAPOINT\_COUNT. Two new FILL variants, two logarithmic functions, two functions for calculating the difference between each datapoint, and five time functions are also now supported. With CloudWatch Metric Math, you can aggregate and transform metrics to create custom visualizations of your health and performance metrics. The new functions announced today allow you to view the logarithmic values of your metric, better visualize the change in latency over time, and calculate the cumulative sales of a product. The new fill variants, REPEAT and LINEAR, make it easier to get more natural graphs from sparse metrics. The TIME\_SERIES function allows you to plot a scalar value, such as the average or maximum value of a metric, as a time series. The DATAPOINT\_COUNT function can be used to count events such as the number of hosts with errors over time. The new time functions can be used to create alarms that only trigger within certain time frames, or use different thresholds during different time frames. For example, using the DAY function you can alarm on a metric with a threshold that changes at the weekend. All of these functions are included in the predefined Metric Math templates available in the CloudWatch console. Go to the metrics tab, click graphed metrics and select the math expression dropdown. You can use these predefined expressions with a single click or use them as a starting point to customize to your needs. Metric Math is available in all AWS Regions where CloudWatch is available. You can use Metric Math expressions in calls to the GetMetricData API and to define dashboards using the API, AWS SDK and AWS Cloud Formation. See [Metric Math syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) and functions for more details.