From b39fe777367619b649ee778ec5460f3eccecbdce Mon Sep 17 00:00:00 2001 From: steffen911 Date: Tue, 7 Jan 2025 14:14:44 +0100 Subject: [PATCH] feat: add documentation for CLICKHOUSE_DB env --- pages/self-hosting/configuration.mdx | 1 + pages/self-hosting/infrastructure/clickhouse.mdx | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pages/self-hosting/configuration.mdx b/pages/self-hosting/configuration.mdx index 0b2bfa3be..948ab2825 100644 --- a/pages/self-hosting/configuration.mdx +++ b/pages/self-hosting/configuration.mdx @@ -25,6 +25,7 @@ You can use the same environment variables for the Langfuse Web and Langfuse Wor | `CLICKHOUSE_URL` | Required | Hostname of the clickhouse instance. Pattern: `http(s)://:(8123/8443)` | | `CLICKHOUSE_USER` | Required | Username of the clickhouse database. Needs SELECT, ALTER, INSERT, CREATE, DELETE grants. | | `CLICKHOUSE_PASSWORD` | Required | Password of the clickhouse user. | +| `CLICKHOUSE_DB` | `default` | Name of the ClickHouse database to use. | | `CLICKHOUSE_CLUSTER_ENABLED` | `true` | Whether to run ClickHouse commands `ON CLUSTER`. Set to `false` for single-container setups. | | `LANGFUSE_AUTO_CLICKHOUSE_MIGRATION_DISABLED` | `false` | Whether to disable automatic ClickHouse migrations on startup. | | `REDIS_CONNECTION_STRING` | Required | Connection string of your redis instance. Instead of `REDIS_CONNECTION_STRING`, you can also use `REDIS_HOST`, `REDIS_PORT`, and `REDIS_AUTH`. | diff --git a/pages/self-hosting/infrastructure/clickhouse.mdx b/pages/self-hosting/infrastructure/clickhouse.mdx index 3493195d8..5b5326c02 100644 --- a/pages/self-hosting/infrastructure/clickhouse.mdx +++ b/pages/self-hosting/infrastructure/clickhouse.mdx @@ -30,11 +30,16 @@ They need to be provided for the Langfuse Web and Langfuse Worker containers. | `CLICKHOUSE_URL` | Required | Hostname of the ClickHouse instance. Pattern: `http(s)://:(8123/8443)` | | `CLICKHOUSE_USER` | Required | Username of the ClickHouse database. Needs SELECT, ALTER, INSERT, CREATE, DELETE grants. | | `CLICKHOUSE_PASSWORD` | Required | Password of the ClickHouse user. | +| `CLICKHOUSE_DB` | `default` | Name of the ClickHouse database to use. | | `CLICKHOUSE_CLUSTER_ENABLED` | `true` | Whether to run ClickHouse commands `ON CLUSTER`. Set to `false` for single-container setups. | | `LANGFUSE_AUTO_CLICKHOUSE_MIGRATION_DISABLED` | `false` | Whether to disable automatic ClickHouse migrations. | -Please note, that Langfuse uses the `default` schema and `default` cluster. -Get in touch with us on [Discord](/discord) or contact the maintainers at support@langfuse.com if this limitation is blocking. +Langfuse uses `default` as the cluster name if CLICKHOUSE_CLUSTER_ENABLED is set to `true`. +You can overwrite this by setting `CLICKHOUSE_CLUSTER_NAME` to a different value. +In that case, the database migrations will not apply correctly as they cannot run dynamically for different clusters. +You must set `LANGFUSE_AUTO_CLICKHOUSE_MIGRATION_DISABLED = false` and run ClickHouse migrations manually. +Clone the Langfuse repository, adjust the cluster name in `./packages/shared/clickhouse/migrations/clustered/*.sql` and run `cd ./packages/shared && sh ./clickhouse/scripts/up.sh` +to manually apply the migrations. ## Deployment Options