Altinity / clickhouse-grafana

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

Series and time are not formatted - Alerting TimeSeries - 9.5.1 #479

Closed gravellierb closed 1 year ago

gravellierb commented 1 year ago

I'm working on an alert rule to check a volume over time. In a dashboard, when I apply my query, I get this result

image

But when I use the same query in an alert, I get this result.

image

You can see that the timestamp is not interpreted correctly and the series names are repeating.

I applied the query using the official clickhouse plugin (panel and alert rule), and I didn't have any problem.

the request is : `SELECT $timeSeries as t, page_domain_name, sum(1) as ad_start FROM $table

WHERE $timeFilter AND event in ( 'ad_start') AND toDate($dateTimeCol) < toDate($to) GROUP BY t, page_domain_name `

And the Generated SQL is: `SELECT (intDiv(toUInt32(timestamp), 86400) 86400) 1000 as t, page_domain_name, sum(1) as ad_start FROM viously.event_ad

WHERE timestamp >= toDateTime(1684508508) AND timestamp <= toDateTime(1684767708) AND event in ( 'ad_start') GROUP BY t, group`

Slach commented 1 year ago

According to https://github.com/Altinity/clickhouse-grafana/issues/478#issuecomment-1571323835 it looks like grafana related issue, doesn't reproduce on grafana/grafana:main (10.1.x) docker image https://github.com/grafana/grafana/pull/69289