Merge branch '2.0.x'
This commit is contained in:
@@ -57,6 +57,25 @@ public class InfluxProperties extends StepRegistryProperties {
|
||||
*/
|
||||
private String retentionPolicy;
|
||||
|
||||
/**
|
||||
* Time period for which Influx should retain data in the current database. For
|
||||
* instance 7d, check the influx documentation for more details on the duration
|
||||
* format.
|
||||
*/
|
||||
private String retentionDuration;
|
||||
|
||||
/**
|
||||
* How many copies of the data are stored in the cluster. Must be 1 for a single node
|
||||
* instance.
|
||||
*/
|
||||
private Integer retentionReplicationFactor;
|
||||
|
||||
/**
|
||||
* Time range covered by a shard group. For instance 2w, check the influx
|
||||
* documentation for more details on the duration format.
|
||||
*/
|
||||
private String retentionShardDuration;
|
||||
|
||||
/**
|
||||
* URI of the Influx server.
|
||||
*/
|
||||
@@ -113,6 +132,30 @@ public class InfluxProperties extends StepRegistryProperties {
|
||||
this.retentionPolicy = retentionPolicy;
|
||||
}
|
||||
|
||||
public String getRetentionDuration() {
|
||||
return this.retentionDuration;
|
||||
}
|
||||
|
||||
public void setRetentionDuration(String retentionDuration) {
|
||||
this.retentionDuration = retentionDuration;
|
||||
}
|
||||
|
||||
public Integer getRetentionReplicationFactor() {
|
||||
return this.retentionReplicationFactor;
|
||||
}
|
||||
|
||||
public void setRetentionReplicationFactor(Integer retentionReplicationFactor) {
|
||||
this.retentionReplicationFactor = retentionReplicationFactor;
|
||||
}
|
||||
|
||||
public String getRetentionShardDuration() {
|
||||
return this.retentionShardDuration;
|
||||
}
|
||||
|
||||
public void setRetentionShardDuration(String retentionShardDuration) {
|
||||
this.retentionShardDuration = retentionShardDuration;
|
||||
}
|
||||
|
||||
public String getUri() {
|
||||
return this.uri;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,24 @@ class InfluxPropertiesConfigAdapter extends
|
||||
InfluxConfig.super::retentionPolicy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer retentionReplicationFactor() {
|
||||
return get(InfluxProperties::getRetentionReplicationFactor,
|
||||
InfluxConfig.super::retentionReplicationFactor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String retentionDuration() {
|
||||
return get(InfluxProperties::getRetentionDuration,
|
||||
InfluxConfig.super::retentionDuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String retentionShardDuration() {
|
||||
return get(InfluxProperties::getRetentionShardDuration,
|
||||
InfluxConfig.super::retentionShardDuration);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String uri() {
|
||||
return get(InfluxProperties::getUri, InfluxConfig.super::uri);
|
||||
|
||||
@@ -32,6 +32,7 @@ public class SignalFxPropertiesConfigAdapter
|
||||
|
||||
public SignalFxPropertiesConfigAdapter(SignalFxProperties properties) {
|
||||
super(properties);
|
||||
accessToken(); // validate that an access token is set
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -54,6 +54,9 @@ public class MetricsEndpointDocumentationTests extends MockMvcEndpointDocumentat
|
||||
.andExpect(status().isOk())
|
||||
.andDo(document("metrics/metric", responseFields(
|
||||
fieldWithPath("name").description("Name of the metric"),
|
||||
fieldWithPath("description")
|
||||
.description("Description of the metric"),
|
||||
fieldWithPath("baseUnit").description("Base unit of the metric"),
|
||||
fieldWithPath("measurements")
|
||||
.description("Measurements of the metric"),
|
||||
fieldWithPath("measurements[].statistic")
|
||||
|
||||
@@ -39,6 +39,12 @@ public class InfluxPropertiesTests extends StepRegistryPropertiesTests {
|
||||
assertThat(properties.getUserName()).isEqualTo(config.userName());
|
||||
assertThat(properties.getPassword()).isEqualTo(config.password());
|
||||
assertThat(properties.getRetentionPolicy()).isEqualTo(config.retentionPolicy());
|
||||
assertThat(properties.getRetentionDuration())
|
||||
.isEqualTo(config.retentionDuration());
|
||||
assertThat(properties.getRetentionReplicationFactor())
|
||||
.isEqualTo(config.retentionReplicationFactor());
|
||||
assertThat(properties.getRetentionShardDuration())
|
||||
.isEqualTo(config.retentionShardDuration());
|
||||
assertThat(properties.getUri()).isEqualTo(config.uri());
|
||||
assertThat(properties.isCompressed()).isEqualTo(config.compressed());
|
||||
assertThat(properties.isAutoCreateDb()).isEqualTo(config.autoCreateDb());
|
||||
|
||||
@@ -91,7 +91,9 @@ public class MetricsEndpoint {
|
||||
Map<Statistic, Double> samples = getSamples(meters);
|
||||
Map<String, Set<String>> availableTags = getAvailableTags(meters);
|
||||
tags.forEach((t) -> availableTags.remove(t.getKey()));
|
||||
return new MetricResponse(requiredMetricName, asList(samples, Sample::new),
|
||||
Meter.Id meterId = meters.get(0).getId();
|
||||
return new MetricResponse(requiredMetricName, meterId.getDescription(),
|
||||
meterId.getBaseUnit(), asList(samples, Sample::new),
|
||||
asList(availableTags, AvailableTag::new));
|
||||
}
|
||||
|
||||
@@ -183,13 +185,19 @@ public class MetricsEndpoint {
|
||||
|
||||
private final String name;
|
||||
|
||||
private final String description;
|
||||
|
||||
private final String baseUnit;
|
||||
|
||||
private final List<Sample> measurements;
|
||||
|
||||
private final List<AvailableTag> availableTags;
|
||||
|
||||
MetricResponse(String name, List<Sample> measurements,
|
||||
List<AvailableTag> availableTags) {
|
||||
MetricResponse(String name, String description, String baseUnit,
|
||||
List<Sample> measurements, List<AvailableTag> availableTags) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.baseUnit = baseUnit;
|
||||
this.measurements = measurements;
|
||||
this.availableTags = availableTags;
|
||||
}
|
||||
@@ -198,6 +206,14 @@ public class MetricsEndpoint {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public String getBaseUnit() {
|
||||
return this.baseUnit;
|
||||
}
|
||||
|
||||
public List<Sample> getMeasurements() {
|
||||
return this.measurements;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
<logback.version>1.2.3</logback.version>
|
||||
<lombok.version>1.18.0</lombok.version>
|
||||
<mariadb.version>2.2.6</mariadb.version>
|
||||
<micrometer.version>1.0.5</micrometer.version>
|
||||
<micrometer.version>1.0.6</micrometer.version>
|
||||
<mockito.version>2.19.1</mockito.version>
|
||||
<mongo-driver-reactivestreams.version>1.9.0</mongo-driver-reactivestreams.version>
|
||||
<mongodb.version>3.8.0</mongodb.version>
|
||||
|
||||
@@ -1414,7 +1414,10 @@ content into your application. Rather, pick only the properties that you need.
|
||||
management.metrics.export.influx.num-threads=2 # Number of threads to use with the metrics publishing scheduler.
|
||||
management.metrics.export.influx.password= # Login password of the Influx server.
|
||||
management.metrics.export.influx.read-timeout=10s # Read timeout for requests to this backend.
|
||||
management.metrics.export.influx.retention-duration= # Time period for which Influx should retain data in the current database.
|
||||
management.metrics.export.influx.retention-shard-duration= # Time range covered by a shard group.
|
||||
management.metrics.export.influx.retention-policy= # Retention policy to use (Influx writes to the DEFAULT retention policy if one is not specified).
|
||||
management.metrics.export.influx.retention-replication-factor= # How many copies of the data are stored in the cluster.
|
||||
management.metrics.export.influx.step=1m # Step size (i.e. reporting frequency) to use.
|
||||
management.metrics.export.influx.uri=http://localhost:8086 # URI of the Influx server.
|
||||
management.metrics.export.influx.user-name= # Login user of the Influx server.
|
||||
|
||||
Reference in New Issue
Block a user