From 3563c975492da066032815ca279a1309b5562db2 Mon Sep 17 00:00:00 2001 From: joffrey-bion Date: Sat, 5 Dec 2020 18:42:06 +0100 Subject: Enable actuator and prometheus metrics --- sw-server/build.gradle.kts | 5 +++++ sw-server/src/main/resources/application.properties | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'sw-server') diff --git a/sw-server/build.gradle.kts b/sw-server/build.gradle.kts index 3d2c3477..0b3e9482 100644 --- a/sw-server/build.gradle.kts +++ b/sw-server/build.gradle.kts @@ -20,8 +20,13 @@ dependencies { // required by spring security when using websockets implementation("org.springframework.security:spring-security-messaging") + // logging implementation("ch.qos.logback:logback-classic:1.1.8") + // monitoring / metrics + implementation("org.springframework.boot:spring-boot-starter-actuator") + implementation("io.micrometer:micrometer-registry-prometheus:1.6.1") + testImplementation(kotlin("test")) testImplementation(kotlin("test-junit")) testImplementation(project(":sw-client")) diff --git a/sw-server/src/main/resources/application.properties b/sw-server/src/main/resources/application.properties index 5ee314c7..bd16f43f 100644 --- a/sw-server/src/main/resources/application.properties +++ b/sw-server/src/main/resources/application.properties @@ -1 +1,5 @@ server.port=8000 + +# enable and expose prometheus endpoint in Spring Boot Actuator +management.endpoint.prometheus.enabled=true +management.endpoints.web.exposure.include=prometheus -- cgit