Skip to content

Commit c98b1fe

Browse files
committed
Start building against Micrometer 1.16.0-M1 snapshots
See gh-46321
1 parent e185bf1 commit c98b1fe

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@ bom {
15181518
releaseNotes("https://github.com/apache/maven-war-plugin/releases/tag/maven-war-plugin-{version}")
15191519
}
15201520
}
1521-
library("Micrometer", "1.15.1") {
1521+
library("Micrometer", "1.16.0-SNAPSHOT") {
15221522
considerSnapshots()
15231523
group("io.micrometer") {
15241524
modules = [

spring-boot-project/spring-boot-metrics/src/main/java/org/springframework/boot/metrics/autoconfigure/export/stackdriver/StackdriverProperties.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ public class StackdriverProperties extends StepRegistryProperties {
6060
*/
6161
private String metricTypePrefix = "custom.googleapis.com/";
6262

63+
/**
64+
* Whether it should be attempted to create a metric descriptor before writing a time
65+
* series.
66+
*/
67+
private boolean autoCreateMetricDescriptors = true;
68+
6369
public String getProjectId() {
6470
return this.projectId;
6571
}
@@ -100,4 +106,12 @@ public void setMetricTypePrefix(String metricTypePrefix) {
100106
this.metricTypePrefix = metricTypePrefix;
101107
}
102108

109+
public boolean isAutoCreateMetricDescriptors() {
110+
return this.autoCreateMetricDescriptors;
111+
}
112+
113+
public void setAutoCreateMetricDescriptors(boolean autoCreateMetricDescriptors) {
114+
this.autoCreateMetricDescriptors = autoCreateMetricDescriptors;
115+
}
116+
103117
}

spring-boot-project/spring-boot-metrics/src/main/java/org/springframework/boot/metrics/autoconfigure/export/stackdriver/StackdriverPropertiesConfigAdapter.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,10 @@ public String metricTypePrefix() {
6565
return get(StackdriverProperties::getMetricTypePrefix, StackdriverConfig.super::metricTypePrefix);
6666
}
6767

68+
@Override
69+
public boolean autoCreateMetricDescriptors() {
70+
return get(StackdriverProperties::isAutoCreateMetricDescriptors,
71+
StackdriverConfig.super::autoCreateMetricDescriptors);
72+
}
73+
6874
}

spring-boot-project/spring-boot-metrics/src/test/java/org/springframework/boot/metrics/autoconfigure/export/stackdriver/StackdriverPropertiesConfigAdapterTests.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ void whenPropertiesMetricTypePrefixIsSetAdapterMetricTypePrefixReturnsIt() {
7777
.isEqualTo("external.googleapis.com/prometheus");
7878
}
7979

80+
@Test
81+
void whenPropertiesAutoCreateMetricDescriptorsIsSetAdapterAutoCreateMetricDescriptorReturnsIt() {
82+
StackdriverProperties properties = new StackdriverProperties();
83+
properties.setAutoCreateMetricDescriptors(false);
84+
assertThat(new StackdriverPropertiesConfigAdapter(properties).autoCreateMetricDescriptors()).isFalse();
85+
}
86+
8087
@Test
8188
@Override
8289
protected void adapterOverridesAllConfigMethods() {

0 commit comments

Comments
 (0)