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

  1. Sign in to ClickHouse Cloud.
  2. In the bottom-left of the console, open your Organization and select Organization Details.
  3. Copy the Organization ID.

Step 2: Create an API key in ClickHouse

For full details, see ClickHouse's API key documentation.

  1. In the ClickHouse Cloud console, go to Settings > API keys.
  2. Select New API Key.
  3. Enter a descriptive name (for example, "CloudZero Integration") in API key name.
  4. Set an Expiration date that matches your security policy.
  5. 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 needRoles
Cost data, tags, region, and cloud providerService 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.
  1. Select Generate API Key.
  2. 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

  1. In CloudZero, go to Settings > Connections.
  2. Select Create Connection + and select the ClickHouse tile.
  3. Enter the connection details:
FieldValue
Connection NameA name for this connection in CloudZero
Organization IDThe Organization ID from Step 1
API Key IDThe Key ID from Step 2
API Key SecretThe Key Secret from Step 2
Fixed IP EgressOptional; see Fixed IP egress
  1. Select Test to confirm CloudZero can read your cost data.
  2. 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.180
  • 52.0.33.111
  • 34.207.222.149
  • 34.193.111.240
  • 100.30.110.234
  • 54.85.9.231
  • 35.175.48.156
  • 100.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.

  1. In CloudZero, go to Settings > Connections and select your ClickHouse connection.
  2. Select Edit.
  3. Enter both the API Key ID and the API Key Secret of the new key. Leave both fields empty to keep the current key.
  4. 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:

TagDescription
ch_cz:entity_typeType of ClickHouse resource (datawarehouse, service, or clickpipe)
ch_cz:entity_nameName of the data warehouse, service, or ClickPipe
ch_cz:data_warehouse_idID of the data warehouse
ch_cz:cloud_providerCloud provider that hosts the service
ch_cz:service_tierTier of the service
ch_cz:organization_tierTier of your ClickHouse organization
ch_cz:is_primary_replicaWhether the service is the primary replica in its data warehouse
ch_cz:clickpipe_source_typeSource 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:

DimensionExample values
AccountYour ClickHouse organization name
ServiceThe type of ClickHouse resource: datawarehouse, service, or clickpipe
Usage FamilyThe cost metric, such as compute, storage, backup, or data_transfer
RegionThe 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.


Did this page help you?