ClickHouse / ClickHouse/dbt-clickhouse

Standarize the http user agent sent by dbt-clickhouse

Open
#618 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
362
Forks
177
Avg merge
2d 10h
Merged PRs (30d)
8

Description

We have two different user-agents depending on the protocol used as we use different libraries for each protocol:
- HTTP one looks like this. in the query_log this is sent in the `http_user_agent` column:
```
dbt-adapters/1.22.5 dbt-clickhouse/1.10.0 clickhouse-connect/0.10.0 (lv:py/3.12.11; mode:sync; os:darwin; os_user:josemunoz)
```
- Native one, the one that actually includes the `ClickHouse` part. In the query_log this is sent in the `client_name` column:
```
ClickHouse dbt-adapters/1.22.5 dbt-clickhouse/1.10.0 clickhouse-driver/0.2.10
```

Ideally, the user agent from dbt should look like this, with the app and the driver in the main side, and the dbt-adapters version in the metadata part:
```
dbt-clickhouse/1.10.0 clickhouse-connect/0.10.0 (dbt-adapters/1.22.5; lv:py/3.12.11; mode:sync; os:darwin; os_user:josemunoz)
```

We need to:
- Send PR to clickhouse-connect to allow adding extra metadata parts.
- Send PR to clickhouse-driver to optionally remove the `ClickHouse ` string and to allow adding metadata.
- Then change dbt-clickhouse to send the `dbt-adapters` version as part of the metadata

Contributor guide

Open the contributing guide

Research direction

Start by locating dbt-clickhouse's setup for the clickhouse-connect HTTP client and clickhouse-driver native client. Review the requested upstream changes for metadata and the optional ClickHouse prefix, then update dbt-clickhouse to include the dbt-adapters version; done means both protocols emit the proposed standardized user-agent format.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.