From 6707c07ced997939a436183167c01db2aca26131 Mon Sep 17 00:00:00 2001 From: Floris Vleugels Date: Thu, 28 Aug 2025 15:59:08 +0200 Subject: [PATCH 1/2] Add actuator monitoring with prometheus endpoint --- pom.xml | 10 +++++++++- .../cbioportal/legacy/web/GeneralControllerAdvice.java | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 246f1d111db..c8b35f1ab26 100644 --- a/pom.xml +++ b/pom.xml @@ -141,6 +141,14 @@ org.springframework.boot spring-boot-starter + + org.springframework.boot + spring-boot-starter-actuator + + + io.micrometer + micrometer-registry-prometheus + org.springframework.boot spring-boot-starter-test @@ -939,4 +947,4 @@ - + \ No newline at end of file diff --git a/src/main/java/org/cbioportal/legacy/web/GeneralControllerAdvice.java b/src/main/java/org/cbioportal/legacy/web/GeneralControllerAdvice.java index c4c5347f413..205fd4211cd 100644 --- a/src/main/java/org/cbioportal/legacy/web/GeneralControllerAdvice.java +++ b/src/main/java/org/cbioportal/legacy/web/GeneralControllerAdvice.java @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice; -@ControllerAdvice +@ControllerAdvice(basePackages = "org.cbioportal.api") public class GeneralControllerAdvice implements ResponseBodyAdvice { @Override From daee09bc7d3b8f0894954517ffc5d97565c171cb Mon Sep 17 00:00:00 2001 From: Floris Vleugels Date: Thu, 28 Aug 2025 16:27:09 +0200 Subject: [PATCH 2/2] Update application properties with actuator examples --- src/main/resources/application.properties.EXAMPLE | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/resources/application.properties.EXAMPLE b/src/main/resources/application.properties.EXAMPLE index baaa864a787..488ecd87a5b 100644 --- a/src/main/resources/application.properties.EXAMPLE +++ b/src/main/resources/application.properties.EXAMPLE @@ -431,6 +431,10 @@ server.max-http-request-header-size=16384 #sentry.traces-sample-rate=1.0 Probably should change for prod #sentry.exception-resolver-order=-2147483647 +# Actuator Configuration +management.endpoints.enabled-by-default=false +management.endpoints.web.exposure.include=health,info + # Swagger Configuration #springdoc.swagger-ui.disable-swagger-default-url=true #springdoc.swagger-ui.path=/api/swagger-ui