Connect Grafana to Tinybird

Grafana can connect to Tinybird using ClickHouse® plugins, taking advantage of Tinybird's ClickHouse® HTTP protocol compatibility through the SQL API (/v0/sql endpoint).

This guide covers how to set up Grafana with Tinybird using two popular ClickHouse® plugins:

Remember you can expose metrics like API Endpoints in Prometheus format. See an example.
And if you want to connect regular API Endpoints and not Data Sources you can use Infinity data source plugin for Grafana.

Prerequisites

  • A Tinybird workspace
  • A Grafana instance (local or cloud)
  • A Tinybird Auth Token with read permissions for the workspace data sources, and Organization data sources.

Install the ClickHouse® plugin

Install one of the ClickHouse® plugins in your Grafana instance:

  1. ClickHouse® plugin - The official ClickHouse® plugin for Grafana
  2. Altinity plugin - developed by Vertamedia, maintaned by Altinity since 2020

Select one based on your needs and install it through the Grafana plugin catalog or using grafana-cli.

Configure the ClickHouse® plugin

If you're using the official ClickHouse® plugin:

  1. Go to Configuration > Data Sources in Grafana
  2. Select Add data source and select ClickHouse®
  3. Configure the connection with these settings:
Server address: <HOST> #your_host, like api.eu-west-1.aws.tinybird.co
Server port: 443
Protocol: HTTP
Secure Connection: yes
HTTP URL Path: /v0/sql
  1. Add a custom HTTP header for authentication:
Header Name: Authorization
Header Value: Bearer <TOKEN>
  1. Select Save & Test to verify the connection
ClickHouse® plugin configuration
ClickHouse® plugin configuration

Configure the Altinity plugin

If you're using the Altinity plugin:

  1. Go to Configuration > Data Sources in Grafana
  2. Select Add data source and select Altinity plugin for ClickHouse®
  3. Configure the connection with these settings:
URL: https://<HOST>/v0/sql # like https://api.eu-west-1.aws.tinybird.co/v0/sql
Access: Server
  1. Add a custom HTTP header for authentication:
Header: Authorization
Value: Bearer <TOKEN>
  1. Select Save & Test to verify the connection
Altinity plugin configuration
Altinity plugin configuration

Test the connection

Once configured, test your connection by creating a simple query:

  1. Create a new dashboard and add a panel
  2. Select your newly created data source
  3. Write a simple query to test the connection

If the connection is working, you should see the result.

Databases and tables

The SQL API exposes four databases: organization, system, tinybird, and workspace:

  • organization: for the Organization data sources, like organization.workspaces, organization.pipe_stats_rt
  • system: for system.tables, system.columns
  • tinybird: for the Workspace Service data sources like tinybird.datasources_ops_log, tinybird.pipe_stats_rt
  • workspace: for your Workspace data sources.

Next steps

  • Explore Grafana's visualization options with your Tinybird data
  • Set up alerts based on your real-time data
  • Create dashboards that combine data from multiple sources
  • Use Grafana variables to make your dashboards interactive

Troubleshooting

Connection failed: Verify that your Auth Token has read permissions and that the host URL is correct for your region.

Query timeout: For large datasets, consider using Materialized Views or adding appropriate filters to your queries.

Authentication errors: Double-check that your Bearer token format is correct.

Updated