This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git
The following commit(s) were added to refs/heads/main by this push:
new 7dff06b CAMEL-17627: camel-health - ExposureLevel option to control
the level of checks in the result
7dff06b is described below
commit 7dff06bf538eb2920175e59ee130de9a320a2a60
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Feb 10 15:31:52 2022 +0100
CAMEL-17627: camel-health - ExposureLevel option to control the level of
checks in the result
---
.../src/main/docs/spring-boot.json | 7 +++++++
.../health/CamelHealthCheckAutoConfiguration.java | 3 +++
.../CamelHealthCheckConfigurationProperties.java | 23 ++++++++++++++++++++++
3 files changed, 33 insertions(+)
diff --git a/core/camel-spring-boot/src/main/docs/spring-boot.json
b/core/camel-spring-boot/src/main/docs/spring-boot.json
index cb4b964..c6a312d 100644
--- a/core/camel-spring-boot/src/main/docs/spring-boot.json
+++ b/core/camel-spring-boot/src/main/docs/spring-boot.json
@@ -414,6 +414,13 @@
"sourceType":
"org.apache.camel.spring.boot.actuate.health.CamelHealthCheckConfigurationProperties"
},
{
+ "name": "camel.health.exposure-level",
+ "type": "java.lang.String",
+ "description": "Sets the level of details to exposure as result of
invoking health checks. There are the following levels: full, default, oneline
The full level will include all details and status from all the invoked health
checks. The default level will report UP if everything is okay, and only
include detailed information for health checks that was DOWN. The oneline level
will only report either UP or DOWN.",
+ "sourceType":
"org.apache.camel.spring.boot.actuate.health.CamelHealthCheckConfigurationProperties",
+ "defaultValue": "default"
+ },
+ {
"name": "camel.health.registry-enabled",
"type": "java.lang.Boolean",
"description": "Whether registry health check is enabled. <p> Is default
enabled",
diff --git
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java
index 0966197..b1f8bd7 100644
---
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java
+++
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckAutoConfiguration.java
@@ -72,6 +72,9 @@ public class CamelHealthCheckAutoConfiguration {
if (config.getExcludePattern() != null) {
hcr.setExcludePattern(config.getExcludePattern());
}
+ if (config.getExposureLevel() != null) {
+ hcr.setExposureLevel(config.getExposureLevel());
+ }
// context is enabled by default
if (hcr.isEnabled()) {
diff --git
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckConfigurationProperties.java
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckConfigurationProperties.java
index 8a3d604..ec54209 100644
---
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckConfigurationProperties.java
+++
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthCheckConfigurationProperties.java
@@ -16,6 +16,7 @@
*/
package org.apache.camel.spring.boot.actuate.health;
+import org.apache.camel.spi.Metadata;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "camel.health")
@@ -62,6 +63,20 @@ public class CamelHealthCheckConfigurationProperties {
*/
private String excludePattern;
+ /**
+ * Sets the level of details to exposure as result of invoking health
checks. There are the following levels: full,
+ * default, oneline
+ *
+ * The full level will include all details and status from all the invoked
health checks.
+ *
+ * The default level will report UP if everything is okay, and only
include detailed information for health checks
+ * that was DOWN.
+ *
+ * The oneline level will only report either UP or DOWN.
+ */
+ @Metadata(enums = "full,default,oneline", defaultValue = "default")
+ private String exposureLevel = "default";
+
public Boolean getEnabled() {
return enabled;
}
@@ -109,6 +124,14 @@ public class CamelHealthCheckConfigurationProperties {
public void setExcludePattern(String excludePattern) {
this.excludePattern = excludePattern;
}
+
+ public String getExposureLevel() {
+ return exposureLevel;
+ }
+
+ public void setExposureLevel(String exposureLevel) {
+ this.exposureLevel = exposureLevel;
+ }
}