Skip to content

Commit a7b13db

Browse files
committed
Merge pull request #13819 from jkschneider:micrometer-1.0.6
* pr/13819: Polish "Upgrade to Micrometer 1.0.6" Upgrade to Micrometer 1.0.6
2 parents dcb68d4 + ecb8da2 commit a7b13db

File tree

6 files changed

+72
-1
lines changed

6 files changed

+72
-1
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxProperties.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,25 @@ public class InfluxProperties extends StepRegistryProperties {
5757
*/
5858
private String retentionPolicy;
5959

60+
/**
61+
* Time period for which Influx should retain data in the current database. For
62+
* instance 7d, check the influx documentation for more details on the duration
63+
* format.
64+
*/
65+
private String retentionDuration;
66+
67+
/**
68+
* How many copies of the data are stored in the cluster. Must be 1 for a single node
69+
* instance.
70+
*/
71+
private Integer retentionReplicationFactor;
72+
73+
/**
74+
* Time range covered by a shard group. For instance 2w, check the influx
75+
* documentation for more details on the duration format.
76+
*/
77+
private String retentionShardDuration;
78+
6079
/**
6180
* URI of the Influx server.
6281
*/
@@ -113,6 +132,30 @@ public void setRetentionPolicy(String retentionPolicy) {
113132
this.retentionPolicy = retentionPolicy;
114133
}
115134

135+
public String getRetentionDuration() {
136+
return this.retentionDuration;
137+
}
138+
139+
public void setRetentionDuration(String retentionDuration) {
140+
this.retentionDuration = retentionDuration;
141+
}
142+
143+
public Integer getRetentionReplicationFactor() {
144+
return this.retentionReplicationFactor;
145+
}
146+
147+
public void setRetentionReplicationFactor(Integer retentionReplicationFactor) {
148+
this.retentionReplicationFactor = retentionReplicationFactor;
149+
}
150+
151+
public String getRetentionShardDuration() {
152+
return this.retentionShardDuration;
153+
}
154+
155+
public void setRetentionShardDuration(String retentionShardDuration) {
156+
this.retentionShardDuration = retentionShardDuration;
157+
}
158+
116159
public String getUri() {
117160
return this.uri;
118161
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxPropertiesConfigAdapter.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@ public String retentionPolicy() {
6060
InfluxConfig.super::retentionPolicy);
6161
}
6262

63+
@Override
64+
public Integer retentionReplicationFactor() {
65+
return get(InfluxProperties::getRetentionReplicationFactor,
66+
InfluxConfig.super::retentionReplicationFactor);
67+
}
68+
69+
@Override
70+
public String retentionDuration() {
71+
return get(InfluxProperties::getRetentionDuration,
72+
InfluxConfig.super::retentionDuration);
73+
}
74+
75+
@Override
76+
public String retentionShardDuration() {
77+
return get(InfluxProperties::getRetentionShardDuration,
78+
InfluxConfig.super::retentionShardDuration);
79+
}
80+
6381
@Override
6482
public String uri() {
6583
return get(InfluxProperties::getUri, InfluxConfig.super::uri);

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxPropertiesConfigAdapter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class SignalFxPropertiesConfigAdapter
3232

3333
public SignalFxPropertiesConfigAdapter(SignalFxProperties properties) {
3434
super(properties);
35+
accessToken(); // validate that an access token is set
3536
}
3637

3738
@Override

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxPropertiesTests.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public void defaultValuesAreConsistent() {
3939
assertThat(properties.getUserName()).isEqualTo(config.userName());
4040
assertThat(properties.getPassword()).isEqualTo(config.password());
4141
assertThat(properties.getRetentionPolicy()).isEqualTo(config.retentionPolicy());
42+
assertThat(properties.getRetentionDuration())
43+
.isEqualTo(config.retentionDuration());
44+
assertThat(properties.getRetentionReplicationFactor())
45+
.isEqualTo(config.retentionReplicationFactor());
46+
assertThat(properties.getRetentionShardDuration())
47+
.isEqualTo(config.retentionShardDuration());
4248
assertThat(properties.getUri()).isEqualTo(config.uri());
4349
assertThat(properties.isCompressed()).isEqualTo(config.compressed());
4450
assertThat(properties.isAutoCreateDb()).isEqualTo(config.autoCreateDb());

spring-boot-project/spring-boot-dependencies/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
<logback.version>1.2.3</logback.version>
123123
<lombok.version>1.16.22</lombok.version>
124124
<mariadb.version>2.2.6</mariadb.version>
125-
<micrometer.version>1.0.5</micrometer.version>
125+
<micrometer.version>1.0.6</micrometer.version>
126126
<mockito.version>2.15.0</mockito.version>
127127
<mongo-driver-reactivestreams.version>1.7.1</mongo-driver-reactivestreams.version>
128128
<mongodb.version>3.6.4</mongodb.version>

spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,7 +1371,10 @@ content into your application. Rather, pick only the properties that you need.
13711371
management.metrics.export.influx.num-threads=2 # Number of threads to use with the metrics publishing scheduler.
13721372
management.metrics.export.influx.password= # Login password of the Influx server.
13731373
management.metrics.export.influx.read-timeout=10s # Read timeout for requests to this backend.
1374+
management.metrics.export.influx.retention-duration= # Time period for which Influx should retain data in the current database.
1375+
management.metrics.export.influx.retention-shard-duration= # Time range covered by a shard group.
13741376
management.metrics.export.influx.retention-policy= # Retention policy to use (Influx writes to the DEFAULT retention policy if one is not specified).
1377+
management.metrics.export.influx.retention-replication-factor= # How many copies of the data are stored in the cluster.
13751378
management.metrics.export.influx.step=1m # Step size (i.e. reporting frequency) to use.
13761379
management.metrics.export.influx.uri=http://localhost:8086 # URI of the Influx server.
13771380
management.metrics.export.influx.user-name= # Login user of the Influx server.

0 commit comments

Comments
 (0)