mysql 表中存储的日期正常,但 grafanfa 读到的数据却快了 8 小时。

解决办法给时间字段加 UNIX_TIMESTAMP() 方法,如将
SELECT
created_at AS "time",
metric AS metric,
value
FROM test
WHERE
$__timeFilter(created_at)
ORDER BY created_at
修改为
SELECT
UNIX_TIMESTAMP(created_at) AS "time",
metric AS metric,
value
FROM test
WHERE
$__timeFilter(created_at)
ORDER BY created_at