-
Notifications
You must be signed in to change notification settings - Fork 697
Add Confluent-Client-Version header to requests to SR, Golang client #1495
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds the Confluent-Client-Version header to Schema Registry REST API requests. The version format is "go/{version}" where the version is derived from the librdkafka library version.
- Introduces a new helper function to generate the client version header value
- Sets the
Confluent-Client-Versionheader during REST service initialization
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // getClientVersionHeaderValue returns the client version header value | ||
| // in the format "go/{version}" | ||
| // Note: currently the client version is tied to the librdkafka version | ||
| func getClientVersionHeaderValue() string { | ||
| _, version := kafka.LibraryVersion() | ||
| return "go/" + version |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment states the version is 'tied to the librdkafka version', but this coupling may be confusing since this is a Schema Registry client. Consider clarifying why the librdkafka version is used for the Schema Registry client version header, or if a dedicated Schema Registry client version should be used instead.
| // getClientVersionHeaderValue returns the client version header value | |
| // in the format "go/{version}" | |
| // Note: currently the client version is tied to the librdkafka version | |
| func getClientVersionHeaderValue() string { | |
| _, version := kafka.LibraryVersion() | |
| return "go/" + version | |
| // getClientVersionHeaderValue returns the Schema Registry client version header value | |
| // in the format "go/{version}" | |
| // Note: this version reflects the Schema Registry client, not the Kafka library version. | |
| const schemaRegistryClientVersion = "1.0.0" // TODO: Update this version as needed for releases | |
| func getClientVersionHeaderValue() string { | |
| return "go/" + schemaRegistryClientVersion |
|
| "strings" | ||
| "time" | ||
|
|
||
| "github.com/confluentinc/confluent-kafka-go/v2/kafka" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid the dependency of the SR client on Kafka?




What
Checklist
References
JIRA: https://confluentinc.atlassian.net/browse/DGS-22770
Test & Review
Open questions / Follow-ups