Icon for QuestDBIcon for Grafana

QuestDB integrates with Grafana

Integrates withCurated

Overview

QuestDB integrates with Grafana through its PostgreSQL wire protocol compatibility. This allows Grafana's native PostgreSQL data source to query QuestDB without requiring a custom plugin.

Integration architecture

Grafana connects to QuestDB using the standard PostgreSQL data source configuration. The connection uses QuestDB's PostgreSQL wire protocol implementation, which translates SQL queries into QuestDB's native query engine.

Grafana → PostgreSQL data source → QuestDB wire protocol → QuestDB query engine

Use cases

  • Real-time manufacturing dashboards showing production metrics
  • OEE monitoring with time-series machine data
  • Energy consumption visualization from IIoT sensors
  • Predictive maintenance alerts based on vibration or temperature trends

Configuration steps

  1. In Grafana, add a new PostgreSQL data source
  2. Set host to your QuestDB instance (e.g., questdb:8812)
  3. Use default database name qdb
  4. Set user to admin (default) and leave password empty
  5. Disable SSL/TLS (QuestDB does not use SSL by default)
  6. Save and test the connection

Query syntax

Use standard SQL with QuestDB-specific time-series functions:

SELECT timestamp, sensor_value
FROM sensor_readings
WHERE sensor_id = 'temp_001'
SAMPLE BY 1h

Tradeoffs and considerations

  • QuestDB's SQL support is broader than InfluxDB's InfluxQL, but some PostgreSQL-specific features may not be fully supported
  • The PostgreSQL wire protocol adds minimal overhead compared to native REST API
  • For high-cardinality data, use QuestDB's SAMPLE BY and LATEST ON functions in queries rather than fetching raw data