diff --git a/pom.xml b/pom.xml index 7e926ec38..bc3a3c506 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ io.getunleash yggdrasil-engine - 0.1.0-alpha.12 + 0.1.0-alpha.13 ${os.detected.classifier} diff --git a/src/main/java/io/getunleash/metric/ClientMetrics.java b/src/main/java/io/getunleash/metric/ClientMetrics.java index 8d70070a8..8b6bfdf85 100644 --- a/src/main/java/io/getunleash/metric/ClientMetrics.java +++ b/src/main/java/io/getunleash/metric/ClientMetrics.java @@ -1,6 +1,7 @@ package io.getunleash.metric; import io.getunleash.engine.MetricsBucket; +import io.getunleash.engine.UnleashEngine; import io.getunleash.event.UnleashEvent; import io.getunleash.event.UnleashSubscriber; import io.getunleash.lang.Nullable; @@ -25,7 +26,7 @@ public class ClientMetrics implements UnleashEvent { this.specVersion = config.getClientSpecificationVersion(); this.platformName = System.getProperty("java.vm.name"); this.platformVersion = System.getProperty("java.version"); - this.yggdrasilVersion = null; + this.yggdrasilVersion = UnleashEngine.getCoreVersion(); } public String getAppName() { diff --git a/src/main/java/io/getunleash/metric/ClientRegistration.java b/src/main/java/io/getunleash/metric/ClientRegistration.java index a820ccf92..8af6f0781 100644 --- a/src/main/java/io/getunleash/metric/ClientRegistration.java +++ b/src/main/java/io/getunleash/metric/ClientRegistration.java @@ -1,5 +1,6 @@ package io.getunleash.metric; +import io.getunleash.engine.UnleashEngine; import io.getunleash.event.UnleashEvent; import io.getunleash.event.UnleashSubscriber; import io.getunleash.lang.Nullable; @@ -31,7 +32,7 @@ public class ClientRegistration implements UnleashEvent { this.specVersion = config.getClientSpecificationVersion(); this.platformName = System.getProperty("java.vm.name"); this.platformVersion = System.getProperty("java.version"); - this.yggdrasilVersion = null; + this.yggdrasilVersion = UnleashEngine.getCoreVersion(); } public String getAppName() { diff --git a/src/test/java/io/getunleash/metric/UnleashMetricServiceImplTest.java b/src/test/java/io/getunleash/metric/UnleashMetricServiceImplTest.java index ea501186e..3b839d323 100644 --- a/src/test/java/io/getunleash/metric/UnleashMetricServiceImplTest.java +++ b/src/test/java/io/getunleash/metric/UnleashMetricServiceImplTest.java @@ -448,7 +448,7 @@ public void should_add_new_metrics_data_to_bucket() { verify(sender, times(1)).sendMetrics(metricsSent.capture()); ClientMetrics metrics = metricsSent.getValue(); assertThat(metrics.getSpecVersion()).isNotEmpty(); - assertThat(metrics.getYggdrasilVersion()).isNull(); + assertThat(metrics.getYggdrasilVersion()).isNotEmpty(); assertThat(metrics.getPlatformName()).isNotEmpty(); assertThat(metrics.getPlatformVersion()).isNotEmpty(); } @@ -467,6 +467,6 @@ public void client_registration_also_includes_new_metrics_metadata() { assertThat(reg.getPlatformName()).isNotEmpty(); assertThat(reg.getPlatformVersion()).isNotEmpty(); assertThat(reg.getSpecVersion()).isEqualTo(config.getClientSpecificationVersion()); - assertThat(reg.getYggdrasilVersion()).isNull(); + assertThat(reg.getYggdrasilVersion()).isNotEmpty(); } }