grafana pie chart解析mysql

示例如下

SELECT
  create_time AS "time",
  count(1) as value,
  case when platform = 1 then 'metric_a'
       when platform = 2 then 'metric_b'
  else 'none' 
  END AS metric
FROM xxtable
group by metric
ORDER BY create_time

生成如图
grafana pie chart解析mysql_第1张图片

如何调试

如果自行写sql写错了,怎么办?到感叹号处点击查看报错信息,并调试sql语句

grafana pie chart解析mysql_第2张图片

你可能感兴趣的:(后端,grafana)