config: expose health probes for active apps
This commit is contained in:
@@ -130,6 +130,10 @@ management:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus,gb32960sessions
|
||||
endpoint:
|
||||
health:
|
||||
probes:
|
||||
enabled: ${MANAGEMENT_HEALTH_PROBES_ENABLED:true}
|
||||
health:
|
||||
redis:
|
||||
enabled: ${MANAGEMENT_HEALTH_REDIS_ENABLED:false}
|
||||
|
||||
@@ -90,6 +90,10 @@ management:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus
|
||||
endpoint:
|
||||
health:
|
||||
probes:
|
||||
enabled: ${MANAGEMENT_HEALTH_PROBES_ENABLED:true}
|
||||
health:
|
||||
redis:
|
||||
enabled: ${MANAGEMENT_HEALTH_REDIS_ENABLED:false}
|
||||
|
||||
@@ -70,6 +70,10 @@ management:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus
|
||||
endpoint:
|
||||
health:
|
||||
probes:
|
||||
enabled: ${MANAGEMENT_HEALTH_PROBES_ENABLED:true}
|
||||
metrics:
|
||||
tags:
|
||||
application: vehicle-analytics-app
|
||||
|
||||
@@ -107,6 +107,10 @@ management:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus
|
||||
endpoint:
|
||||
health:
|
||||
probes:
|
||||
enabled: ${MANAGEMENT_HEALTH_PROBES_ENABLED:true}
|
||||
health:
|
||||
redis:
|
||||
enabled: ${MANAGEMENT_HEALTH_REDIS_ENABLED:false}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.lingniu.ingest.historyapp;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
|
||||
import org.springframework.core.io.FileSystemResource;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@@ -47,6 +50,24 @@ class PortainerComposeResourceLimitsTest {
|
||||
.contains("JAVA_OPTS: ${JAVA_OPTS:---sun-misc-unsafe-memory-access=allow -XX:+UseZGC -XX:MaxRAMPercentage=75}");
|
||||
}
|
||||
|
||||
@Test
|
||||
void activeAppsExposeHealthProbeGroupsByDefault() {
|
||||
Path root = repositoryRoot();
|
||||
List<Path> activeAppConfigs = List.of(
|
||||
root.resolve("modules/apps/gb32960-ingest-app/src/main/resources/application.yml"),
|
||||
root.resolve("modules/apps/jt808-ingest-app/src/main/resources/application.yml"),
|
||||
root.resolve("modules/apps/yutong-mqtt-app/src/main/resources/application.yml"),
|
||||
root.resolve("modules/apps/vehicle-history-app/src/main/resources/application.yml"),
|
||||
root.resolve("modules/apps/vehicle-analytics-app/src/main/resources/application.yml"));
|
||||
|
||||
for (Path config : activeAppConfigs) {
|
||||
assertThat(yamlProperties(config))
|
||||
.as(config.toString())
|
||||
.containsEntry("management.endpoint.health.probes.enabled",
|
||||
"${MANAGEMENT_HEALTH_PROBES_ENABLED:true}");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
void dockerEntrypointExecsJavaForSignalHandling() throws IOException {
|
||||
String dockerfile = Files.readString(repositoryRoot().resolve("Dockerfile"));
|
||||
@@ -388,6 +409,14 @@ class PortainerComposeResourceLimitsTest {
|
||||
return compose.substring(start, end);
|
||||
}
|
||||
|
||||
private static Properties yamlProperties(Path path) {
|
||||
YamlPropertiesFactoryBean factory = new YamlPropertiesFactoryBean();
|
||||
factory.setResources(new FileSystemResource(path));
|
||||
Properties properties = factory.getObject();
|
||||
assertThat(properties).isNotNull();
|
||||
return properties;
|
||||
}
|
||||
|
||||
private static Path repositoryRoot() {
|
||||
Path current = Path.of(System.getProperty("user.dir")).toAbsolutePath();
|
||||
while (current != null) {
|
||||
|
||||
@@ -100,6 +100,10 @@ management:
|
||||
web:
|
||||
exposure:
|
||||
include: health,info,metrics,prometheus
|
||||
endpoint:
|
||||
health:
|
||||
probes:
|
||||
enabled: ${MANAGEMENT_HEALTH_PROBES_ENABLED:true}
|
||||
health:
|
||||
redis:
|
||||
enabled: ${MANAGEMENT_HEALTH_REDIS_ENABLED:false}
|
||||
|
||||
Reference in New Issue
Block a user