Expose X-ClickHouse-Server-Display-Name header via client-v2 API#2744
Open
synhershko wants to merge 1 commit intoClickHouse:mainfrom
Open
Expose X-ClickHouse-Server-Display-Name header via client-v2 API#2744synhershko wants to merge 1 commit intoClickHouse:mainfrom
synhershko wants to merge 1 commit intoClickHouse:mainfrom
Conversation
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>
|
|
chernser
reviewed
Feb 13, 2026
| String queryId = HttpAPIClientHelper.getHeaderVal(httpResponse.getFirstHeader(ClickHouseHttpProto.HEADER_QUERY_ID), requestSettings.getQueryId(), String::valueOf); | ||
| metrics.operationComplete(); | ||
| metrics.setQueryId(queryId); | ||
| metrics.setServerDisplayName(HttpAPIClientHelper.getHeaderVal( |
Contributor
There was a problem hiding this comment.
@synhershko
Metrics is not a good place for headers:
- header is not a metrics
- we will rework metrics and removing header from it will be problematic
- native protocol may have another way to pass this information.
I suggest:
- create
Map<String, String> collectResponseHeaders(HttpResponse)inHttpAPIClientHelper - add
Map<String, String> responseHeadersto insert and query response classes - it can be a getters for significant headers or a getter method returning all headers.
Thank you!
chernser
requested changes
Feb 13, 2026
Contributor
|
Good day, @synhershko ! Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extract the server display name from HTTP response headers and surface it through OperationMetrics, QueryResponse, InsertResponse, and CommandResponse, following the existing queryId pattern.
Note
Low Risk
Small, additive API change that only reads an extra response header and exposes it via new getters; minimal behavioral impact beyond the metrics/response surface.
Overview
Surfaces the
X-ClickHouse-Server-Display-NameHTTP response header through the client-v2 API.Clientnow captures this header intoOperationMetrics, andQueryResponse,InsertResponse, andCommandResponseaddgetServerDisplayName()accessors (mirroring the existingqueryIdplumbing), withOperationMetrics#toString()updated accordingly.Written by Cursor Bugbot for commit 1e47a0b. This will update automatically on new commits. Configure here.