Managed ClickHouse
Lens can store its data in ClickHouse Cloud, so you run only the Lens container and ClickHouse Cloud operates the database, its replicas and its backups. Lens creates its own database, tables and application state on first start. You do not configure Keeper or any server setting
This setup was qualified with Lens 0.8.0 on a ClickHouse Cloud service running ClickHouse 26.6 with three replicas: startup and schema setup, trace ingestion and reads, tracing key changes, and a restart with data intact
1. Copy the connection details
In the ClickHouse Cloud console, open your service and click Connect. Copy the host, which looks like abc123.us-east-2.aws.clickhouse.cloud, and the password of the default user. Lens uses the HTTPS port, 8443
2. Start Lens
docker run -d --name lens -p 4318:4318 \
-e LENS_MODE=standalone \
-e LENS_ADMIN_TOKEN=<a-long-random-token> \
-e CLICKHOUSE_URL="https://default:<url-encoded-password>@<host>:8443" \
-e CLICKHOUSE_DATABASE=lens \
ghcr.io/berriai/lens:0.8.0
URL-encode special characters in the password. Lens is ready when curl --fail http://localhost:4318/health/ready succeeds, usually within a few seconds
3. Send a trace
Open http://localhost:4318/ui/, sign in with the admin token and follow Send your first trace. Your traces are stored in the lens database of your ClickHouse Cloud service
Kubernetes
Store the same URL in a Kubernetes Secret and reference it from the Lens Helm chart. The reference turns off the bundled ClickHouse
clickhouseSecret:
name: lens-clickhouse
key: url
clickhouseDatabase: lens
Use a dedicated database user
The default user is the fastest start. For production, run this once in the ClickHouse Cloud SQL console and put lens and its password in CLICKHOUSE_URL instead:
CREATE DATABASE IF NOT EXISTS lens;
CREATE USER lens IDENTIFIED BY '<password>';
GRANT CURRENT GRANTS ON lens.* TO lens;
GRANT ALL ON lens.* is rejected on ClickHouse Cloud, so use GRANT CURRENT GRANTS
Troubleshooting
| Lens startup error | What to check |
|---|---|
Storage(Storage(Transport)) | The host, port 8443 and https scheme, and that the service IP access list allows the machine running Lens |
Storage(Storage(SchemaFailed(500))) or SchemaFailed(403) | The database user lacks permissions on the Lens database. Apply the grant above |
Other managed ClickHouse providers have not been qualified. They need the KeeperMap table engine and the permissions described in Storage and secrets