Skip to content

Expose X-ClickHouse-Server-Display-Name header via client-v2 API#2744

Merged
chernser merged 2 commits into
ClickHouse:mainfrom
BigDataBoutique:expose-server-display-name-header
Feb 14, 2026
Merged

Expose X-ClickHouse-Server-Display-Name header via client-v2 API#2744
chernser merged 2 commits into
ClickHouse:mainfrom
BigDataBoutique:expose-server-display-name-header

Conversation

@synhershko

@synhershko synhershko commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Extract the server display name from HTTP response headers and surface it through OperationMetrics, QueryResponse, InsertResponse, and CommandResponse, following the existing queryId pattern.

Closes #2347


Note

Low Risk
Additive API surface that only reads and exposes a small, whitelisted set of response headers; minimal impact on request/response flow aside from extra header collection.

Overview
Client-v2 now captures a whitelisted set of ClickHouse HTTP response headers and attaches them to operation results.

Client passes collected headers into QueryResponse and InsertResponse, while QueryResponse, InsertResponse, and CommandResponse expose getServerDisplayName() (from X-ClickHouse-Server-Display-Name) plus getResponseHeaders() for the full collected map. HttpAPIClientHelper adds collectResponseHeaders() with a fixed whitelist to avoid exposing arbitrary headers.

Written by Cursor Bugbot for commit 8932875. This will update automatically on new commits. Configure here.

Extract the server display name from HTTP response headers and surface
it through OperationMetrics, QueryResponse, InsertResponse, and
CommandResponse, following the existing queryId pattern.

Signed-off-by: Itamar Syn-Hershko <itamar@bigdataboutique.com>
@CLAassistant

CLAassistant commented Feb 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Comment thread client-v2/src/main/java/com/clickhouse/client/api/Client.java Outdated
@chernser

Copy link
Copy Markdown
Contributor

Good day, @synhershko !
Thank you for the contribution!
Please see my comment.

Thanks!

@synhershko

Copy link
Copy Markdown
Contributor Author

@chernser updated

@chernser chernser merged commit a0cea8c into ClickHouse:main Feb 14, 2026
18 of 21 checks passed
@chernser

Copy link
Copy Markdown
Contributor

Thank you @synhershko !

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.

[client-v2] Support returning raw http header

3 participants