amazon-cloudwatch

AWS Cloudwatch Math Expressions: draw null / empty


I am trying to create a dashboard widget that says "if a metric sample count is less than certain number, don't draw the graph".

The only Math expression that seem promising is IF, however the value can only be a metric or a scalar. I'm trying to find a way to draw a null/no data point/empty instead.

Any way?

Reference: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#using-IF-expressions


Solution

  • CloudWatch will drop data points that are not numbers (NaN, +Infinity, -Infinity) when graphing the data. Also, metric math will evaluate basic operations in the expression. You can divide by zero to get non-number value.

    So you can do something like this to trick it into dropping the values you don't want: