Browse Source

Start building against Micrometer 1.14.0 snapshots

See gh-42555
pull/42395/head
Andy Wilkinson 1 year ago
parent
commit
83afef4f60
  1. 16
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java
  2. 7
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticPropertiesConfigAdapter.java
  3. 9
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticPropertiesConfigAdapterTests.java
  4. 2
      spring-boot-project/spring-boot-dependencies/build.gradle

16
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticProperties.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -79,6 +79,12 @@ public class ElasticProperties extends StepRegistryProperties { @@ -79,6 +79,12 @@ public class ElasticProperties extends StepRegistryProperties {
*/
private String apiKeyCredentials;
/**
* Whether to enable _source in the default index template when auto-creating the
* index.
*/
private boolean enableSource = false;
public String getHost() {
return this.host;
}
@ -159,4 +165,12 @@ public class ElasticProperties extends StepRegistryProperties { @@ -159,4 +165,12 @@ public class ElasticProperties extends StepRegistryProperties {
this.apiKeyCredentials = apiKeyCredentials;
}
public boolean isEnableSource() {
return this.enableSource;
}
public void setEnableSource(boolean enableSource) {
this.enableSource = enableSource;
}
}

7
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticPropertiesConfigAdapter.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -87,4 +87,9 @@ class ElasticPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter @@ -87,4 +87,9 @@ class ElasticPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter
return get(ElasticProperties::getApiKeyCredentials, ElasticConfig.super::apiKeyCredentials);
}
@Override
public boolean enableSource() {
return get(ElasticProperties::isEnableSource, ElasticConfig.super::enableSource);
}
}

9
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/elastic/ElasticPropertiesConfigAdapterTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -104,4 +104,11 @@ class ElasticPropertiesConfigAdapterTests @@ -104,4 +104,11 @@ class ElasticPropertiesConfigAdapterTests
assertThat(new ElasticPropertiesConfigAdapter(properties).apiKeyCredentials()).isEqualTo("secret");
}
@Test
void whenPropertiesEnableSourceIsSetAdapterEnableSourceReturnsIt() {
ElasticProperties properties = new ElasticProperties();
properties.setEnableSource(true);
assertThat(new ElasticPropertiesConfigAdapter(properties).enableSource()).isTrue();
}
}

2
spring-boot-project/spring-boot-dependencies/build.gradle

@ -1305,7 +1305,7 @@ bom { @@ -1305,7 +1305,7 @@ bom {
]
}
}
library("Micrometer", "1.14.0-M3") {
library("Micrometer", "1.14.0-SNAPSHOT") {
considerSnapshots()
group("io.micrometer") {
modules = [

Loading…
Cancel
Save