Connecting to ClickHouse
Connect your ClickHouse Cloud accounts to CloudZero to bring your ClickHouse cost data into a unified view of all your cloud and AI spend. CloudZero organizes your ClickHouse costs, along with your other costs, into categories (called Dimensions) that matter most to your business. For example: business unit, team, product, feature, environment, customer, or virtually anything else. Once connected and organized, you can quickly answer questions about your spend that matter to your stakeholders.
This guide covers creating a ClickHouse Cloud API key and configuring the connection in CloudZero. CloudZero ingests daily organization-level cost data along with service and ClickPipes metadata. CloudZero only reads your ClickHouse data and never modifies it.
ClickHouse reports costs in ClickHouse Credits (CHC). One CHC is equivalent to one US dollar.
What you need
- CloudZero user with data configuration permissions
- A ClickHouse Cloud account with permissions to create API keys
Step 1: Copy your Organization ID
- Sign in to ClickHouse Cloud.
- In the bottom-left of the console, open your Organization and select Organization Details.
- Copy the Organization ID.
Step 2: Create an API key in ClickHouse
For full details, see ClickHouse's API key documentation.
- In the ClickHouse Cloud console, go to Settings > API keys.
- Select New API Key.
- Enter a descriptive name (for example, "CloudZero Integration") in API key name.
- Set an Expiration date that matches your security policy.
- From the Roles list, select the roles this key needs. To see what a role grants, hover over the permissions link below its name (for example, 21 permissions).
| You need | Roles |
|---|---|
| Cost data, tags, region, and cloud provider | Service API Reader. Roles without service access, including Member and Billing, return no services even though they reach your cost data, so CloudZero cannot ingest your ClickHouse tags, region, or cloud provider. |
| ClickPipes costs (required if you use ClickPipes) | Add a role that includes the View and manage ClickPipes permission. Service API Admin includes it; Service API Reader does not. |
- Select Generate API Key.
- Copy the Key ID and Key Secret immediately. ClickHouse displays the Key Secret only once.
ClickHouse does not offer a view-only ClickPipes permission. Its console permissions reference lists only
control-plane:service:manage-clickpipes, so granting View and manage ClickPipes also allows creating and deleting ClickPipes. CloudZero only reads this data.
Step 3: Configure the connection in CloudZero
- In CloudZero, go to Settings > Connections.
- Select Create Connection + and select the ClickHouse tile.
- Enter the connection details:
| Field | Value |
|---|---|
| Connection Name | A name for this connection in CloudZero |
| Organization ID | The Organization ID from Step 1 |
| API Key ID | The Key ID from Step 2 |
| API Key Secret | The Key Secret from Step 2 |
| Fixed IP Egress | Optional; see Fixed IP egress |
- Select Test to confirm CloudZero can read your cost data.
- Select Create Connection.
Test checks your Organization ID and API key against your cost data only. It does not check service or ClickPipes access, so confirm the key's roles match Step 2.
What to expect
After you connect, CloudZero begins ingesting your ClickHouse cost data. Your ClickHouse costs appear across the platform within 24 hours. Once data is available, you can view costs broken down by service, data warehouse, ClickPipe, region, cloud provider, cost metric (compute, storage, backup, data transfer, and others), and tags. See Connection details for where each one appears.
From there, your ClickHouse costs work like any other cost data in CloudZero. For example, you can organize them by team or product using Dimensions, track trends in Dashboards, set Budgets, or ask questions in the AI Hub.
If the connection shows an error and no cost data appears, check the API key's ClickPipes permission. A key without View and manage ClickPipes connects successfully, but if any of your services has ClickPipes costs, CloudZero cannot ingest cost data for the connection. To resolve this, create a key with a role that includes the permission and update the connection's credentials.
Maintenance and configuration
Fixed IP egress
If your ClickHouse Cloud account only accepts requests from approved IP addresses, select Use fixed IP egress on the CloudZero connection, then add the following addresses to your ClickHouse Cloud IP allowlist:
52.0.118.18052.0.33.11134.207.222.14934.193.111.240100.30.110.23454.85.9.23135.175.48.156100.50.61.179
ClickHouse sets IP restrictions per API key. See ClickHouse's API key documentation.
For how fixed IP egress works, see Fixed IP egress.
Update credentials
You can replace the API key without creating a new connection.
- In CloudZero, go to Settings > Connections and select your ClickHouse connection.
- Select Edit.
- Enter both the API Key ID and the API Key Secret of the new key. Leave both fields empty to keep the current key.
- Select Save Changes.
Connection details
Tags
CloudZero ingests any tags you have set on your ClickHouse Cloud services. Tags appear with your original key names (for example, environment, team, project) and are available for use in Dimensions. New keys are picked up automatically at each ingestion.
Tag ingestion depends on the API key being able to read your services, so the key needs the Service API Reader role described in Step 2. ClickPipes costs carry the tags of the service they belong to.
Tags are set through the ClickHouse Cloud API or the ClickHouse Terraform provider.
The connection also provides tags with the ch_cz prefix:
| Tag | Description |
|---|---|
ch_cz:entity_type | Type of ClickHouse resource (datawarehouse, service, or clickpipe) |
ch_cz:entity_name | Name of the data warehouse, service, or ClickPipe |
ch_cz:data_warehouse_id | ID of the data warehouse |
ch_cz:cloud_provider | Cloud provider that hosts the service |
ch_cz:service_tier | Tier of the service |
ch_cz:organization_tier | Tier of your ClickHouse organization |
ch_cz:is_primary_replica | Whether the service is the primary replica in its data warehouse |
ch_cz:clickpipe_source_type | Source type of the ClickPipe, such as kafka |
Service tags, region, cloud provider, and tier reflect your services as they are when CloudZero ingests data. Costs for services you have since deleted appear without them.
Cloud Provider Dimensions
CloudZero maps your ClickHouse cost data to the following categories (called Cloud Provider Dimensions), which you can group and filter by across the platform:
| Dimension | Example values |
|---|---|
| Account | Your ClickHouse organization name |
| Service | The type of ClickHouse resource: datawarehouse, service, or clickpipe |
| Usage Family | The cost metric, such as compute, storage, backup, or data_transfer |
| Region | The region of the service, or no-region when CloudZero cannot determine it |
| Resource | <type>/<name>, for example service/production-analytics |
Have questions or feedback? Reach out to your account manager.
Updated 8 days ago

