> ## Documentation Index
> Fetch the complete documentation index at: https://docs.synq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# DWH Agent

> Integrating to databases via on-premise installed Coalesce Quality agent

<Note>
  This guide explains how to configure the Coalesce Quality Data Warehouse agent installed on-premise.

  When possible, use standard integration methods as they are much simpler and provide full functionality.

  Reach out to us for installation details.
</Note>

## Data we collect

For the automated data anomaly testing, we collect the following:

* Number of rows in every table in the monitored dataset(s)
* Timestamp of the last change of data in all tables in the monitored dataset(s)

**We provide built-in monitors for data volume and freshness without accessing your actual data. However, for custom monitors, the agent needs access to query your raw data. Only the aggregated results are sent to the platform.**

# Setup DWH Agent integration

1. In the app, navigate to Data Sources and click "Add integration"

2. Select "On-premise DWH Agent" from the list of available integrations

3. Enter a title for your integration (e.g., "Production DWH Agent")

4. Click "Create". You will receive:

   * `client_id`
   * `client_secret`

   Save these credentials - you'll need them to configure the agent in the next section.

<Note>
  Keep your client credentials secure. They allow the agent to authenticate with
  the platform.
</Note>

# Agent Configuration

Agent is configured via `agent.yaml` file or through environment variables.

## Example configuration:

```yaml theme={null}
# yaml-language-server: $schema=https://schemas.synq.io/synq-dwh/v1/config.schema.json
synq:
  client_id: "xxxx-xxxx-xxxx-xxx"
  client_secret: "${SYNQ_CLIENT_SECRET}"

connections:
  "pg-local":
    name: "PG Local"
    postgres:
      host: 1.2.3.4
      port: 54320
      username: postgres
      password: ${PG_PASSWORD}
      database: db
      allow_insecure: true

  "bq-nifty-motif-341212":
    bigquery:
      project_id: big-query-project-id
      region: europe-west2

  "ch-staging":
    name: Clickhouse
    clickhouse:
      host: host.clickhouse.cloud
      port: 9440
      username: default
      password: ${STAGING_CLICKHOUSE_PASSWORD}

  "prod-snowflake":
    disabled: true
    snowflake:
      username: "SYNQ"
      password: "${SNOWFLAKE_DWH_PASSSWORD}"
      account: "snowflake-account"
      warehouse: "SYNQ_WH"
      databases: ["DB"]
      role: "SYNQ_ROLE"
      use_get_ddl: true
```

For details about all available configuration options, refer to the [JSON Schema](https://schemas.synq.io/synq-dwh/v1/config.schema.json) or the [HTML documentation](https://schemas.synq.io/synq-dwh/v1/config.html).
