-
Notifications
You must be signed in to change notification settings - Fork 74
feat: add ClickHouse single tenant mode (ingestion only) #2949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Add support for running Logflare in single tenant mode with ClickHouse as the backend for log ingestion. This follows the same virtual backend pattern used for PostgreSQL single tenant mode, where backend_id is nil and configuration is read from environment variables. Query/search functionality is intentionally excluded from this implementation.
Ziinc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor tweaks needed
| ) | ||
|
|
||
| System.get_env("LOGFLARE_SINGLE_TENANT", "false") == "true" && | ||
| not is_nil(System.get_env("CLICKHOUSE_URL")) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| not is_nil(System.get_env("CLICKHOUSE_URL")) -> | |
| not is_nil(System.get_env("CLICKHOUSE_BACKEND_URL")) -> |
| config :logflare, | ||
| :clickhouse_backend_adapter, | ||
| filter_nil_kv_pairs.( | ||
| url: System.get_env("CLICKHOUSE_URL"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| url: System.get_env("CLICKHOUSE_URL"), | |
| url: System.get_env("CLICKHOUSE_BACKEND_URL"), |
| :clickhouse_backend_adapter, | ||
| filter_nil_kv_pairs.( | ||
| url: System.get_env("CLICKHOUSE_URL"), | ||
| database: System.get_env("CLICKHOUSE_DATABASE"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| database: System.get_env("CLICKHOUSE_DATABASE"), | |
| database: System.get_env("CLICKHOUSE_BACKEND_DATABASE"), |
| filter_nil_kv_pairs.( | ||
| url: System.get_env("CLICKHOUSE_URL"), | ||
| database: System.get_env("CLICKHOUSE_DATABASE"), | ||
| username: System.get_env("CLICKHOUSE_USERNAME"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| username: System.get_env("CLICKHOUSE_USERNAME"), | |
| username: System.get_env("CLICKHOUSE_BACKEND_USERNAME"), |
| url: System.get_env("CLICKHOUSE_URL"), | ||
| database: System.get_env("CLICKHOUSE_DATABASE"), | ||
| username: System.get_env("CLICKHOUSE_USERNAME"), | ||
| password: System.get_env("CLICKHOUSE_PASSWORD") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| password: System.get_env("CLICKHOUSE_PASSWORD") | |
| password: System.get_env("CLICKHOUSE_BACKEND_PASSWORD") |
| end | ||
|
|
||
| def clickhouse_conn_manager_children do | ||
| if SingleTenant.clickhouse_backend?() do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This child spec shouldn't be needed as it should be supervised by QueryConnectionSup
|
|
||
| start.st.ch: ERL_NAME = st_ch | ||
| start.st.ch: PORT ?= 4000 | ||
| start.st.ch: ENV_FILE = .single_tenant_ch.env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will. Need a ch env file as well
|
Also need to add self hosting documentation and new env vars to table |
Add support for running Logflare in single tenant mode with ClickHouse as the backend. This follows the same virtual backend pattern used for PostgreSQL single tenant mode, where backend_id is nil and configuration is read from environment variables.
Query/search functionality is excluded from this implementation, as bigger changes are required to support them.