This commit is contained in:
Francesco Mangiacrapa 2024-10-18 16:50:07 +02:00
parent e7d6a2d707
commit 8cea8b9aea
2 changed files with 4 additions and 5 deletions

View File

@ -17,8 +17,7 @@ public class GeoportalHealthCheck implements HealthCheck {
@Override @Override
public HealthCheckResponse call() { public HealthCheckResponse call() {
log.info(GeoportalHealthCheck.class.getSimpleName() + " call"); log.info(GeoportalHealthCheck.class.getSimpleName() + " call");
HealthCheckResponse response = HealthCheckResponse.named(SERVICE_NAME).state(true) HealthCheckResponse response = HealthCheckResponse.named(SERVICE_NAME).state(true).build();
.withData("serviceStatus", "healthy").build();
return response; return response;
} }

View File

@ -45,7 +45,7 @@ public class MongoHealthCheck implements HealthCheck {
int i = 1; int i = 1;
for (String coll : collections) { for (String coll : collections) {
log.info("adding collection: {}", coll); log.info("adding collection: {}", coll);
buildHCRBuilder.withData("collection " + i, coll); buildHCRBuilder.withData("collection_" + i, coll);
i++; i++;
} }
return buildHCRBuilder.build(); return buildHCRBuilder.build();
@ -57,7 +57,7 @@ public class MongoHealthCheck implements HealthCheck {
connection = mongo.getConnection(); connection = mongo.getConnection();
buildHCRBuilder = appendMongoInfo(buildHCRBuilder, connection); buildHCRBuilder = appendMongoInfo(buildHCRBuilder, connection);
} catch (Exception e1) { } catch (Exception e1) {
buildHCRBuilder.withData("hosts ", connection.getHosts() + ""); buildHCRBuilder.withData("hosts", connection.getHosts() + "");
} }
} }
@ -69,7 +69,7 @@ public class MongoHealthCheck implements HealthCheck {
private HealthCheckResponseBuilder appendMongoInfo(HealthCheckResponseBuilder buildHCRBuilder, private HealthCheckResponseBuilder appendMongoInfo(HealthCheckResponseBuilder buildHCRBuilder,
MongoConnection connection) { MongoConnection connection) {
buildHCRBuilder.withData("hosts ", connection.getHosts() + ""); buildHCRBuilder.withData("hosts", connection.getHosts() + "");
buildHCRBuilder.withData("db_name ", connection.getDatabase()); buildHCRBuilder.withData("db_name ", connection.getDatabase());
return buildHCRBuilder; return buildHCRBuilder;
} }