Clickhouse minutely data, group by hour and show average delta for that hour

  • What Grafana version and what operating system are you using?

v9.1.1 (9e60a1bff1)

  • What are you trying to achieve?

Show average metric deltas (metric value from the LAST minute less metric value from the FIRST minute of given hour), grouped by hour of the day

My date is minutely

  • How are you trying to achieve it?

Tried with SQL GROUP BY, but clickhouse don’t support aggregation by HOUR() function.
Tried with Grafana Group By transformation, but results are confusing

  • What happened?

Query error or random data

  • What did you expect to happen?

To have a chart with metric deltas, gruped by hour of the day

  • Can you copy/paste the configuration(s) that you are having problems with?

SELECT HOUR(dt) AS hh,MINUTE(dt) AS mm,metric_a FROM metrics WHERE code = ‘${code}’ AND dt>NOW()-INTERVAL 20 DAY

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.


  • Did you follow any online instructions? If so, what is the URL?

can’t find relevant