Grafana
Connect Grafana to your Tinybird RawTree deployment and run a SQL query in Explore.
Connect Grafana to Tinybird RawTree
Grafana can query your RawTree tables through the deployment’s direct HTTPS endpoint. Tinybird RawTree is protocol-compatible with ClickHouse® and you can take advantage of ClickHouse's data source from Grafana Labs.
Get the deployment hostname and API key
This setup requires your deployment-specific hostname and a direct HTTPS endpoint for SQL on port 8443.
For a cloud deployment, use the Database SQL interface that matches your cluster’s deployment ID.
| Cloud region | Database SQL interface |
|---|---|
N. Virginia (us-east-1) | https://api.765eb5f5.us-east-1.aws.rawtree.com:8443/ |
Ireland (eu-west-1) | https://api.78d4d9f2.eu-west-1.aws.rawtree.com:8443/ |
- Open your cluster in the Tinybird RawTree dashboard.
- Open Connect → App (API/SDK).
- Copy the Regional API hostname that matches
api.<deployment_id>.<cloud_region>.aws.rawtree.com. - Create a key for Grafana with Read only access under API keys.
You can also obtain the regional ID using the CLI or API.
Set RAWTREE_API_KEY to the read-only key you created for Grafana.
Both examples use jq to show the deployment ID and cloud region for your cluster.
curl -fsS "https://api.rawtree.com/v1/clusters" \
-H "Authorization: Bearer $RAWTREE_API_KEY" |
jq '.clusters[] | {deployment_id, cloud_region}'rtree cluster list --api-url https://api.rawtree.com --json |
jq '.clusters[] | {deployment_id, cloud_region}'Configure the Grafana data source
- Open Connections → Add new connection in Grafana.
- Select ClickHouse by Grafana Labs.
- Install the plugin if Grafana prompts you.
- Select Add new data source.
- Enter the connection settings below.
| Grafana setting | Value |
|---|---|
Server address | The deployment hostname only. Omit https://, the port, and the path. |
Protocol | HTTP |
Secure Connection | On |
Server port | 8443 |
Skip TLS Verify | Off |
HTTP URL Path | Leave empty to use /. |
Username and Password | Leave both empty. |
Set the bearer token under Custom HTTP Headers.
- Select Add Header.
- Enter
AuthorizationinHeader Name. - Enable
Secure. - Enter
Bearer <API_KEY>inSecure Header Value, substituting your read-only key for<API_KEY>. - Select Save & test.
Grafana reports Data source is working.
Run a query
- Open Explore in Grafana.
- Select the data source you just configured.
- Select SQL Editor.
- Run this query in Table format.
SELECT 1 AS connectedThe result contains one row with 1 in the connected column.
If Grafana reports 401 Unauthorized, check the bearer header and the key’s expiration.
If the connection times out, check that the Grafana server can reach the deployment hostname on TCP port 8443.