So I’m using a graph panel in order to illustrate the number of packages sent from a provider every day, however on the time-span where there were no packages sent, the graph is not putting these values to zero as I would prefer it to. Instead it connects them as if it were obeying the “if NULL: connected” parameter, however it obviously isn’t NULL, it just doesn’t exist… I’ll have a picture and a snippet of the query in order to illustrate this below:
SELECT DATE(do_timestamp) as time,
count(do_timestamp) as value,
'Packages Sent' as metric
FROM <data table>
WHERE $__timeFilter(do_timestamp)
GROUP BY DATE(do_timestamp)
ORDER BY DATE(do_timestamp) ASC;
Unfortunately I only have SELECT/SHOW permissions so altering the database or adding anything as far as I’m aware is not possible. I’m pretty new to MySQL and SQLin general, so if I’m missing something here, do let me know.
SELECT $__timeGroup(do_timestamp, ‘5m’,0) as time,
count(do_timestamp) as value,
‘Packages Sent’ as metric
FROM
WHERE $__timeFilter(do_timestamp)
GROUP BY DATE(do_timestamp)
ORDER BY DATE(do_timestamp) ASC;
Using $__timeGroup(do_timestamp, ‘5m’,0) has one issue though. This way Grafana is the one deciding when should be the starting time and end time of aggregation. Which for instance in $__timeGroup(do_timestamp, ‘43800m’,0) it it very likely that it starts e.g. from 2019-01-20 till 2019-02-19 instead of from 2019-02-01 till 2019-02-28.