- Open Grafana's UI (by default available at
- Go to the
Configurationsection and click on
Add data source
- Choose the
PostgreSQLplugin and configure it with the following settings:
- When adding a panel, use the “text edit mode” by clicking on the pencil icon and add your query
To simplify syntax and to allow for dynamic parts, like date range filters, the query can contain macros.
This macro tells Grafana to send the start-time and end-time defined in the dashboard to the QuestDB server. It translates to:
This macro calculates a dynamic interval based on the time range applied to the dashboard. By using this function, the sampling interval changes automatically as the user zooms in and out of the panel.