mullerpeter / databricks-grafana

Grafana Databricks integration allowing direct connection to Databricks to query and visualize Databricks data in Grafana.
Apache License 2.0
55 stars 4 forks source link

Support for milliseconds #77

Closed jarandmoen closed 5 months ago

jarandmoen commented 5 months ago

Not supporting milliseconds When zooming into a timeseries the $__timeWindow do not support milliseconds.

Reproduce Grafana query string used SELECT $__time(timestamp), $__value(data) FROM table.part_raw WHERE tag == 'sensor' AND $__timeFilter(timestamp) GROUP BY $__timeWindow(timestamp)

  1. Zoom in to a high resolution timeseries
  2. Resulting SQL:
SELECT
  window.start,
  avg(data) AS value
FROM
  table.part_raw
WHERE
  tag == 'sensor'
  AND timestamp BETWEEN '2023-06-21 17:28:10'
  AND '2023-06-21 17:33:12'
GROUP BY
  window(timestamp, '')

Notice the lack of proper time bin window in the group by.

Expected behavior Support of milliseconds when zooming

SELECT
  window.start,
  avg(data) AS value
FROM
  table.part_raw
WHERE
  tag == 'sensor'
  AND timestamp BETWEEN '2023-06-21 17:28:10'
  AND '2023-06-21 17:33:12'
GROUP BY
  window(timestamp, '1 milliseconds')

Workaround Fixing Grafana "Min Interval" to 1 second

Environment: Plugin Version: 1.2.4 Grafana Version: 10.4.0 ADB Serverless: Current (v 2024.15)

mullerpeter commented 5 months ago

Hi @jarandmoen

Thanks a lot for opening the issue! I added milliseconds support for the macro now. The v1.2.5 release should resolve the issue.