diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java index 7764813d87..4924bf37a4 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdProperties.java @@ -71,11 +71,23 @@ public class StatsdProperties { */ private Duration pollingFrequency = Duration.ofSeconds(10); + /** + * The step size to use in computing windowed statistics like max. The default is 1 + * minute. To get the most out of these statistics, align the step interval to be + * close to your scrape interval. + */ + private Duration step = Duration.ofMinutes(1); + /** * Whether to send unchanged meters to the StatsD server. */ private boolean publishUnchangedMeters = true; + /** + * Whether measurements should be buffered before sending to the StatsD server. + */ + private boolean buffered = true; + public boolean isEnabled() { return this.enabled; } @@ -132,6 +144,14 @@ public class StatsdProperties { this.pollingFrequency = pollingFrequency; } + public Duration getStep() { + return this.step; + } + + public void setStep(Duration step) { + this.step = step; + } + public boolean isPublishUnchangedMeters() { return this.publishUnchangedMeters; } @@ -140,4 +160,12 @@ public class StatsdProperties { this.publishUnchangedMeters = publishUnchangedMeters; } + public boolean isBuffered() { + return this.buffered; + } + + public void setBuffered(boolean buffered) { + this.buffered = buffered; + } + } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdPropertiesConfigAdapter.java index 9913faa156..1cb671294a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/statsd/StatsdPropertiesConfigAdapter.java @@ -81,9 +81,19 @@ public class StatsdPropertiesConfigAdapter extends PropertiesConfigAdapter