"count()" of 720, but when selecting "last()" the result is "no data"

I’m trying to create an alert rule to get notified when a certain backend no longer pushes a value called ‘export_interval’ to the Influx database.

The problem I’m facing is that the following query results in no data:

SELECT last("export_interval") FROM "ABC" WHERE $timeFilter GROUP BY "backend_name", "environment"

If I change last to count the result is 720.

SELECT count("export_interval") FROM "ABC" WHERE $timeFilter GROUP BY "backend_name", "environment"

How can there be no last, if there is a count?

I’ve tried all combinations of “Format as” and the three buttons on the right:

what happens if you try

SELECT last("export_interval") FROM "ABC" WHERE $timeFilter

Does one really need group by when it is last?

Still “no data” when I remove the "group-by"s. However, I do need them, since I want to see three separate last values, each from a different backend.

1 Like

what data source is this? influxdb?

Yes, the data source is influxdb.

Can you share the screenshots of your entire alert rule configuration, along with the preview of the output (click the blue Preview alerts button). For example:

A: the non-working LAST query (and separately, the working COUNT query)
B: the reduction or classic condition expression
C: the expression that you are alerting on

A1:
Non working LAST:

A2: working COUNT

B: I don’t have that yet, as there is no data to reduce.
C: I don’t have that yet, as there is no data to alert on.

Do you think this is a bug, or do you need more information?