Grafana turns ClickHouse query results into interactive dashboards, but the connection setup and query optimization process trips up many developers the first time they try it. The official ClickHouse plugin for Grafana supports both HTTP and native protocols, yet choosing the right configuration depends on your infrastructure, security requirements, and performance goals.
This guide walks through installing the Grafana plugin, configuring secure connections, writing optimized queries with Grafana macros, and troubleshooting common errors that prevent dashboards from loading correctly.
Why use Grafana with ClickHouse for real-time analytics
Grafana turns ClickHouse query results into visual dashboards that update as new data arrives. When you connect the two, you get fast analytical queries from ClickHouse combined with Grafana's charting and visualization options for building monitoring dashboards.
This pairing works well for observability scenarios like tracking application performance metrics, monitoring system health, or analyzing user behavior patterns. ClickHouse handles high-volume queries with sub-second response times, while Grafana renders those results as interactive time-series charts, tables, and log panels.
Version and plugin compatibility matrix
The official ClickHouse plugin for Grafana works with ClickHouse versions 21.1 and later. Grafana 8.0 and above supports the plugin, though Grafana 9.0 or later provides the best experience with regular plugin updates and improved query builder features.
ClickHouse server versions and protocols
ClickHouse exposes two protocols for external connections: HTTP on port 8123 and native TCP on port 9000. The Grafana plugin supports both, though HTTP is more common because it works through standard web infrastructure without special network configuration.
Newer ClickHouse versions starting with 23.0 include performance improvements for the HTTP interface and better support for query progress tracking, with throughput jumping to 962 QPS in concurrent workloads. Older versions still work but lack some newer optimization features.
Grafana OSS vs Grafana Cloud support
Both Grafana Open Source and Grafana Cloud support the ClickHouse plugin, with slightly different installation processes. With Grafana OSS, you install the plugin manually using grafana-cli
or through the web interface. Grafana Cloud includes a plugin catalog where you enable the ClickHouse plugin with one click, and updates happen automatically.
Prerequisites and connection options
Before connecting Grafana to ClickHouse, you'll want a running ClickHouse instance with network access from your Grafana server. You'll also want credentials for a ClickHouse user account, ideally with read-only permissions if you're only building dashboards.
Native plugin vs Tinybird HTTPS endpoint
You can connect Grafana to ClickHouse in two ways: directly through the native plugin or by querying Tinybird via its HTTP interface. Direct connection means managing your own ClickHouse infrastructure, including server maintenance, security updates, and scaling as your data grows.
Tinybird provides managed ClickHouse infrastructure with built-in HTTPS API endpoints that work with Grafana's standard HTTP data source. This removes the operational work of running ClickHouse yourself, and Tinybird handles scaling, backups, and performance optimization automatically.