I have composed MySQL annotations query which returns both time
and timeEnd
columns of the same type. Unfortunately it seems that Grafana interprets timeEnd
differently from time
, basically, fails to convert it internally to timestamp:
Here is how the event looks like when I run the query manually from CLI:
SELECT prev_last_updated_ts AS time, last_updated_ts AS timeEnd, 'Charging' AS text FROM ...
+-------------------+-------------------+----------+
| time | timeEnd | text |
+-------------------+-------------------+----------+
| 1734106799.903517 | 1734110399.611093 | Charging |
+-------------------+-------------------+----------+
and that is how it looks like if I apply FROM_UNIXTIME()
(just for testing purposes):
SELECT FROM_UNIXTIME(prev_last_updated_ts) AS time, FROM_UNIXTIME(last_updated_ts) AS timeEnd, 'Charging' AS text FROM ...
+----------------------------+----------------------------+----------+
| time | timeEnd | text |
+----------------------------+----------------------------+----------+
| 2024-12-13 17:19:59.903517 | 2024-12-13 18:19:59.611093 | Charging |
+----------------------------+----------------------------+----------+
Also I think there should be a dummy check that timeEnd ≥ time
(show a warning?).