From 50616a9d86d06ea454d57929d174ba4946bc42c4 Mon Sep 17 00:00:00 2001 From: Naxin Date: Thu, 4 Dec 2025 14:26:24 -0500 Subject: [PATCH] update --- schemaregistry/internal/rest_service.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/schemaregistry/internal/rest_service.go b/schemaregistry/internal/rest_service.go index f2937b3d5..f3180353b 100644 --- a/schemaregistry/internal/rest_service.go +++ b/schemaregistry/internal/rest_service.go @@ -36,6 +36,7 @@ import ( "strings" "time" + "github.com/confluentinc/confluent-kafka-go/v2/kafka" "github.com/confluentinc/confluent-kafka-go/v2/schemaregistry/rest" "golang.org/x/oauth2/clientcredentials" ) @@ -85,6 +86,14 @@ const ( TargetIdentityPoolIDKey = "Confluent-Identity-Pool-Id" ) +// 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 +} + // API represents a REST API request type API struct { method string @@ -148,6 +157,7 @@ func NewRestService(conf *ClientConfig) (*RestService, error) { headers.Set("Content-Type", "application/vnd.schemaregistry.v1+json") headers.Set("Confluent-Accept-Unknown-Properties", "true") + headers.Set("Confluent-Client-Version", getClientVersionHeaderValue()) authenticationHeaderProvider, err := NewAuthenticationHeaderProvider(urls[0], conf) if err != nil {