# ClickHouse

> Connect ClickHouse as a datasource for anomaly detection

Rocketgraph reads from your existing ClickHouse — no SDK changes needed.

## Setup

```bash
export ROCKETGRAPH_API_KEY=rg_live_xxxxxx
npx @rgraph/otel-node init
```

Or connect manually at [rocketgraph.app/settings](https://rocketgraph.app/settings):

1. **URL** — e.g. `https://your-clickhouse:8443` or `http://localhost:8123`
2. **Database** — e.g. `default` or `otel`
3. **User** — a read-only user (see below)
4. **Password**

### Create a read-only user

```sql
CREATE USER rocketgraph_readonly IDENTIFIED BY 'your_password';
GRANT SELECT ON your_database.* TO rocketgraph_readonly;
```

Once connected, Rocketgraph queries your ClickHouse logs for ML anomaly detection and deploy regression analysis.
