From a5d5908c27cca7545c543c4259453bb235bc9a71 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Fri, 21 Jul 2023 17:24:26 +0100 Subject: [PATCH] Add missing management.metrics.export.atlas properties Closes gh-36496 --- .../metrics/export/atlas/AtlasProperties.java | 33 ++++++++++++++++++- .../atlas/AtlasPropertiesConfigAdapter.java | 12 ++++++- .../AtlasPropertiesConfigAdapterTests.java | 14 ++++++++ .../export/atlas/AtlasPropertiesTests.java | 4 ++- 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasProperties.java index 55ca2209575..6c2081579b7 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2020 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,6 +78,21 @@ public class AtlasProperties { */ private boolean lwcEnabled; + /** + * Step size (reporting frequency) to use for streaming to Atlas LWC. This is the + * highest supported resolution for getting an on-demand stream of the data. It must + * be less than or equal to management.metrics.export.atlas.step and + * management.metrics.export.atlas.step should be an even multiple of this value. + */ + private Duration lwcStep = Duration.ofSeconds(5); + + /** + * Whether expressions with the same step size as Atlas publishing should be ignored + * for streaming. Used for cases where data being published to Atlas is also sent into + * streaming from the backend. + */ + private boolean lwcIgnorePublishStep = true; + /** * Frequency for refreshing config settings from the LWC service. */ @@ -170,6 +185,22 @@ public class AtlasProperties { this.lwcEnabled = lwcEnabled; } + public Duration getLwcStep() { + return this.lwcStep; + } + + public void setLwcStep(Duration lwcStep) { + this.lwcStep = lwcStep; + } + + public boolean isLwcIgnorePublishStep() { + return this.lwcIgnorePublishStep; + } + + public void setLwcIgnorePublishStep(boolean lwcIgnorePublishStep) { + this.lwcIgnorePublishStep = lwcIgnorePublishStep; + } + public Duration getConfigRefreshFrequency() { return this.configRefreshFrequency; } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasPropertiesConfigAdapter.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasPropertiesConfigAdapter.java index a79323f1174..32458682b98 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasPropertiesConfigAdapter.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/atlas/AtlasPropertiesConfigAdapter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,6 +84,16 @@ class AtlasPropertiesConfigAdapter extends PropertiesConfigAdapter