All technological notes.
Use Grafana to visualize time series data in MySQL.
Query must return 3 mandatory columns:
metric: the metric namevalue: the metric valuetime_sec: the unix time stamp, can use unix_timestamp functionSELECT
unix_timestamp(s.SalesDateTime) AS time_sec
, p.ProductName AS metric
, Sum(s.Amount) AS value
FROM Products AS p
JOIN Sales AS s
ON p.ProductID = s.ProductID
GROUP BY p.ProductName, s.SalesDataTime
HAVING $__timeFilter(s.SalesDataTime) -- filter timerange dynamically.
;