Metric math enables you to query multiple CloudWatch metrics and use math expressions to create new time series based on these metrics. You can visualize the resulting time series on the CloudWatch console and add them to dashboards. Using AWS Lambda metrics as an example, you can divide the
Errors metric by the
Invocations metric to get an error rate. You can then add the resulting time series to a graph on your CloudWatch dashboard.
Read all about Math expressions here.
ClusterName, Namespace, PodNamedimension.
ClusterName="PetSite" Namespace="kube-system" MetricName="pod_cpu_utilization"
Your screen should look similar to the screenshot shown below.
As shown above, the graph shows the
pod_cpu_utilization metric from the different pods that are all part of the Kubernetes data plane.
math expression, then
All functions, followed by
This allows you to use a Metric Math expression to sum all the metrics and show them as a single line on the graph.
See the GIF below for clarification.
Doing this creates a new expression which uses the Metric Match function called
SUM(). When you supply
METRICS() as an argument to the
SUM() expression, it aggregates all the metrics that are graphed except the ones that are math expressions.
You can also achieve the same result without using the
METRICS() function as shown below, where m1,m2 and m3 being the metric Ids.
Notice that you can also create CloudWatch Alarms based on Metric math expressions.
There are numerous such expressions available for you to operate on Metric data.
To see all expressions simply click on
Math expression and check out the various functions available.
This concludes this section. You may continue on to the next section.