Handling missing data for an inactive AWS/SQS DLQ in Grafana CloudWatch Datasource

Hello everyone,

  • What Grafana version and what operating system are you using?

Grafana v10.4.1

  • What are you trying to achieve?

I’m working on a Grafana panel and alert that uses the AWS/SQS Metrics via the CloudWatch datasource. I’m encountering an issue where the data is sometimes missing when the queue goes inactive. I’m using an expression where one value uses a min of a metric and with the missing data I always get the new value as max and min (because there is no other data before this). How can I ensure that no data is transformed to 0 for all missing datapoints?

  • How are you trying to achieve it?

I tried different things like transform data, but I did not find any way to achieve the result i want.
I think I’m looking for something like MySQLs __timeGroup macro, but for AWS Cloudwatch Metrics.

Your help would be much appreciated.

Regards,
Deno

Hey Deno -

With this question:

How can I ensure that no data is transformed to 0 for all missing datapoints?

I’m assuming you want transform any null data to 0 for your monitoring purposes. It seems like a similar question has been asked here with regards to Cloudwatch metrics.

I’m wondering if the answer above helps address your issue? Have you tried using the FILL() function per the Cloudwatch metric math docs?

Hope this helps!

Alternatively in Grafana Alerting (which may require more intervention on your part), you could use Math operations when writing expression queries.

Specifically, the is_number function that will return 1 for all numbers and 0 for all other values (which are null , Inf+ , Inf- , and NaN ).