Null Value Handling

  • What Grafana version and what operating system are you using?
    Grafana v11.1.0 (5b85c4c2fc)

  • What are you trying to achieve?
    I want to convert null data from a CloudWatch EC2 instance to display as red in Grafana, indicating downtime.

  • How are you trying to achieve it?
    I am currently able to display CPU usage and set thresholds for green and yellow in Grafana. However, when the Auto Scaling Group (ASG) is down, no data is shown in Grafana (same as in CloudWatch). I want to configure Grafana to show null data as a red threshold to represent downtime periods. Additionally, I would like to gather the downtime periods and display them in a separate table.

Any idea or hint on how I can achieve this?

You need 2 timeseries (panel queries), which will be stacked:

  • uptime (green) what you have
  • downtime (red) : 1-uptime

Use CloudWatch math for that:

1 Like

Thanks for your link. It was really helpful, and I can now get the uptime and total minutes.
With the attached, I can see 6k minutes, but it seems CloudWatch math is unable to convert this into hours/minutes. Is it possible to convert it to HH:mm with any other Transform data?

I tried with Add field from calculation but seems it can only do basic calculation.

Just set correct unit on that panel (seconds/minutes )