I have a stat panel with two queries. query 1 calculates the number of records that meet a certain condition. query 2 calculates the total number of records. It also has a transform which calculates query1 as fraction of query 2.
Let’s say my time range is set to the last 15 minutes, and the last occurrence of the condition for query 1 is more than 15 minutes ago (meaning the query 1 resultant time series is empty), Grafana displays the result of query 2 as the value of the stat panel, instead of 0.
I’m not sure if this is a bug, and if so, in which component?
I’ve managed to get around the issue by adjusting the Relative time of the 1st query to a longer timeframe in which it is always guaranteed to generate a timeseries result, but is this the only solution? Am I wrong to expect a zero value in this case?