Skip to content
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

Browser-like user-agent #1182

Merged
merged 8 commits into from
Jan 8, 2023
Merged

Browser-like user-agent #1182

merged 8 commits into from
Jan 8, 2023

Conversation

zhicwu
Copy link
Contributor

@zhicwu zhicwu commented Jan 8, 2023

Only works for http protocol. It seems ClickHouse discarded the user agent from gRPC client resulting empty http_user_agent in system.query_log.

User-Agent format:

<product name>/<product version> (<o/s name>/<o/s version>; <jvm name>/<jvm version>[; <additionalProperty>]; rv:<product revision>)

The change applies to Java Client, JDBC Driver and R2DBC driver and the difference is just the product name, first part of user-agent. Taking JDBC driver as an example:

Options system.query_log.http_user_agent
(default) ClickHouse-JdbcDriver/0.4.0-SNAPSHOT (Mac OS X/13.1; OpenJDK 64-Bit Server VM/Temurin-17+35; Apache-HttpClient/5.2.1; rv:f00a176)
http_connection_provider=HTTP_CLIENT ClickHouse-JdbcDriver/0.4.0-SNAPSHOT (Mac OS X/13.1; OpenJDK 64-Bit Server VM/Temurin-17+35; HttpClient; rv:f00a176)
http_connection_provider=APACHE_HTTP_CLIENT ClickHouse-JdbcDriver/0.4.0-SNAPSHOT (Mac OS X/13.1; OpenJDK 64-Bit Server VM/Temurin-17+35; Apache-HttpClient/5.2.1; rv:f00a176)

Closes #1177.

@zhicwu zhicwu linked an issue Jan 8, 2023 that may be closed by this pull request
@zhicwu zhicwu merged commit 555a0a9 into ClickHouse:master Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement setClientInfo Add version info to client_name
1 participant