Altinity / clickhouse-grafana

Altinity Grafana datasource plugin for ClickHouse®
MIT License
713 stars 120 forks source link

alert metric name problem #499

Closed myshzzx closed 9 months ago

myshzzx commented 9 months ago

image

my sql looks like select time, metric, count() from xx group by time,metric

and show like image

then I add an alert , and get notice like this image

Slach commented 9 months ago

duplicated with previous issue try follow suggestion here https://github.com/Altinity/clickhouse-grafana/issues/498#issuecomment-1829409212

Slach commented 9 months ago

try to following query

SELECT
    t,
    groupArray((metric, cnt)) AS groupArr
FROM (
  select time AS t, metric, count() cnt from xx group by t,metric
)
GROUP BY t
ORDER BY t