diff --git a/client.go b/client.go index 2500fca..f323e70 100644 --- a/client.go +++ b/client.go @@ -18,6 +18,7 @@ const ( deprecatedSuffix = "/features" clientName = "unleash-client-go" clientVersion = "4.1.1" + specVersion = "4.3.1" ) var defaultStrategies = []strategy.Strategy{ diff --git a/metrics.go b/metrics.go index ebda680..5477130 100644 --- a/metrics.go +++ b/metrics.go @@ -37,6 +37,9 @@ type MetricsData struct { // Optional field that describes the sdk version (name:version) SDKVersion string `json:"sdkVersion"` + + // Which version of the Unleash-Client-Spec is this SDK validated against + SpecVersion string `json:"specVersion"` } // ClientData represents the data sent to the unleash during registration. @@ -65,6 +68,9 @@ type ClientData struct { PlatformName string `json:"platformName"` YggdrasilVersion *string `json:"yggdrasilVersion"` + + // Which version of the Unleash-Client-Spec is this SDK validated against + SpecVersion string `json:"specVersion"` } type metric struct { @@ -204,6 +210,7 @@ func (m *metrics) sendMetrics() { PlatformName: "go", PlatformVersion: runtime.Version(), YggdrasilVersion: nil, + SpecVersion: specVersion, } u, _ := m.options.url.Parse("./client/metrics") @@ -335,5 +342,6 @@ func (m *metrics) getClientData() ClientData { runtime.Version(), "go", nil, + specVersion, } } diff --git a/metrics_test.go b/metrics_test.go index f6bb6b6..270d3b5 100644 --- a/metrics_test.go +++ b/metrics_test.go @@ -456,6 +456,7 @@ func TestMetrics_ClientDataIncludesNewMetadata(t *testing.T) { PlatformVersion: runtime.Version(), PlatformName: "go", YggdrasilVersion: nil, + SpecVersion: specVersion, }). Reply(200) client, err := NewClient(