DevilKing's blog

冷灯看剑,剑上几分功名?炉香无需计苍生,纵一穿烟逝,万丈云埋,孤阳还照古陵

0%

Use Mysql In Grafana

原文链接

将mysql当成TSDB来使用

1
2
3
4
5
6
7
SELECT
title as 'Title',
user.login as 'Created By' ,
dashboard.created as 'Created On'
FROM dashboard
INNER JOIN user on user.id = dashboard.created_by
WHERE $__timeFilter(dashboard.created)

Another option is a query that can create a key/value variable. The query should return two columns that are named __text and __value

在sql的基础上,掺杂了一些自定义的time函数,来支持TSDB