Browse Source

Merge pull request #11922 from jkschneider:micrometer-389

* pr/11922:
  Polish "Add influx property to govern whether db is auto-created or not"
  Add influx property to govern whether db is auto-created or not
pull/11910/merge
Stephane Nicoll 8 years ago
parent
commit
825397bc57
  1. 13
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxProperties.java
  2. 5
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/influx/InfluxPropertiesConfigAdapter.java
  3. 1
      spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc

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

@ -67,6 +67,12 @@ public class InfluxProperties extends StepRegistryProperties { @@ -67,6 +67,12 @@ public class InfluxProperties extends StepRegistryProperties {
*/
private Boolean compressed;
/**
* Whether to create the Influx database if it does not exist before attempting to
* publish metrics to it.
*/
private Boolean autoCreateDb;
public String getDb() {
return this.db;
}
@ -123,4 +129,11 @@ public class InfluxProperties extends StepRegistryProperties { @@ -123,4 +129,11 @@ public class InfluxProperties extends StepRegistryProperties {
this.compressed = compressed;
}
public Boolean getAutoCreateDb() {
return this.autoCreateDb;
}
public void setAutoCreateDb(Boolean autoCreateDb) {
this.autoCreateDb = autoCreateDb;
}
}

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

@ -70,4 +70,9 @@ class InfluxPropertiesConfigAdapter extends @@ -70,4 +70,9 @@ class InfluxPropertiesConfigAdapter extends
return get(InfluxProperties::getCompressed, InfluxConfig.super::compressed);
}
@Override
public boolean autoCreateDb() {
return get(InfluxProperties::getAutoCreateDb, InfluxConfig.super::autoCreateDb);
}
}

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

@ -1340,6 +1340,7 @@ content into your application. Rather, pick only the properties that you need. @@ -1340,6 +1340,7 @@ content into your application. Rather, pick only the properties that you need.
management.metrics.export.graphite.rate-units= # Base time unit used to report rates.
management.metrics.export.graphite.step= # Step size (i.e. reporting frequency) to use.
management.metrics.export.graphite.tags-as-prefix= # For the default naming convention, turn the specified tag keys into part of the metric prefix.
management.metrics.export.influx.auto-create-db= # Whether to create the Influx database if it does not exist before attempting to publish metrics to it.
management.metrics.export.influx.batch-size= # Number of measurements per request to use for the backend. If more measurements are found, then multiple requests will be made.
management.metrics.export.influx.compressed= # Enable GZIP compression of metrics batches published to Influx.
management.metrics.export.influx.connect-timeout= # Connection timeout for requests to the backend.

Loading…
Cancel
Save