Grafana is a popular observability and monitoring application used to visualize data and has an extensive ecosystem of widgets and plugins. QuestDB supports connecting to Grafana via the Postgres endpoint.
- Grafana should be installed and running.
- QuestDB should be installed and running via Docker, the binaries or Homebrew for macOS users.
- 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 the pencil icon and adding a query
To simplify queries which have dynamic elements such as date range filters, the query can contain global variables which are documented in the Grafana reference documentation.
This variable allows filtering results by sending a start-time and end-time to QuestDB. This expression evaluates to:
This variable 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.