Agentic infrastructure with clickhousectl: a distributed ClickStack across three continents A developer used ClickHouse's CLI tool clickhousectl to build a multi-region observability platform with three ClickHouse Cloud services in the US, Europe, and Japan, each ingesting OpenTelemetry logs, traces, and metrics, with a global view in Europe. The project demonstrates how a clean CLI enables an agent to operate infrastructure as easily as editing code, turning a distributed setup into an afternoon of work. In my last post I built a full-stack retail app, ClickShop https://clickhouse.com/blog/agentic-coding-app , with a coding agent and the ClickHouse stack. That project was about writing application code. This one is about something different: standing up and operating real infrastructure. I gave the agent a single command-line tool, clickhousectl https://clickhouse.com/docs/interfaces/cli , and one goal: a multi-region observability platform with three ClickHouse Cloud services in the US, Europe, and Japan, each ingesting OpenTelemetry logs, traces, and metrics, and one global view in Europe. What I want to share is less the result than the experience of building it. When your platform speaks a clean CLI, an agent can operate it the same way it edits code: it runs a command, reads the JSON it gets back, and decides the next step. That is what turned a multi-region setup into an afternoon of work. The use case As an SA I keep seeing the same starting point at customers: the application is already distributed. You run close to your users in the US, Europe, and Asia, for latency and often for compliance. And the moment the app is spread out, its telemetry is too. Shipping every log line from Tokyo into one central cluster is slow, costly, and frequently not allowed. So you live with a tension. Each region has to keep its own logs, traces, and metrics where they are produced, yet the on-call engineer still needs one screen that answers a single question: is the whole system healthy, everywhere? The point of this project was to show you don't have to choose between the two. My scenario was deliberately small: - A ClickHouse Cloud service in the US us-east-1 , one in Europe eu-west-1 , and one in Japan ap-northeast-1 . - Each service ingests the OpenTelemetry data from its own region. - Europe carries one consolidated view over all three, and only reaches the other regions when that view is actually queried. Figure 1. Distributed storage, one global view. Each region keeps its telemetry local while Europe exposes a single view that is queried on demand and read by the ClickStack UI. The architecture Ingestion is regional and self-contained. In each region the app sends OTel data to a local collector, which writes into the ClickHouse service sitting next to it. Nothing crosses a border on the write path. Europe does one extra job. It hosts a small otel global database that presents the three regions as a single set of tables, and the ClickStack UI reads from there. Two ordinary ClickHouse features do all the work: remoteSecure is a secure pointer to a table on another service. It stores nothing of its own; when you read through it, ClickHouse fetches the rows from the remote region at query time.- The Merge engine exposes several tables as one. In Europe I merge the local EU table with the two remote pointers, so a single SELECT can span three continents. A query on EU data stays inside Europe; the US and Japan services are contacted only when a query genuinely needs them. Figure 2. The full setup. Each region ingests through its own OpenTelemetry collector into a local ClickHouse service, and Europe federates the three with remoteSecure and the Merge engine behind the ClickStack UI. Get started today Interested in seeing how ClickHouse works on your data? Get started with ClickHouse Cloud in minutes and receive $300 in free credits. Sign up https://console.clickhouse.cloud/signUp?loc=blog-cta-1363-get-started-today-sign-up&utm blogctaid=1363 Putting clickhousectl to work clickhousectl is the CLI for ClickHouse local and cloud https://clickhouse.com/blog/introducing-clickhousectl-official-cli-for-clickhouse-local-and-cloud that allows agents to prototype locally on your laptop, and stand up production infrastructure in ClickHouse Cloud. For one service I might have clicked through the Cloud console. For three services in three regions, each with its own connection details and SQL to run, clicking is the wrong tool. An agent with the CLI can run through the entire flow much faster. Every step the build needed, create a service, wait for it, read its connection details, run SQL, tear it all down, is one command, and every command can answer in JSON. 1 Install the ClickHouse Agent Skills to give agents a headstart 2clickhousectl skills 3 authenticate an API key is what an agent or a CI job uses 4clickhousectl cloud auth login --api-key