diff --git a/server/build.gradle.kts b/server/build.gradle.kts index 98ce4ae..5fcb9a1 100644 --- a/server/build.gradle.kts +++ b/server/build.gradle.kts @@ -43,6 +43,8 @@ dependencies { implementation("com.google.code.findbugs:jsr305:3.0.2") implementation ("org.springframework.cloud:spring-cloud-starter-config") implementation("org.springframework.cloud:spring-cloud-starter-openfeign") + implementation("io.micrometer:micrometer-core") + implementation("io.micrometer:micrometer-registry-prometheus") modules { module("org.springframework.boot:spring-boot-starter-logging") { diff --git a/server/src/main/resources/application-prod.yml b/server/src/main/resources/application-prod.yml index 918c402..e561382 100644 --- a/server/src/main/resources/application-prod.yml +++ b/server/src/main/resources/application-prod.yml @@ -28,3 +28,7 @@ spring: redis: host: 172.18.0.3 port: 6379 + + application: + name: monitoring + diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml index ca45a47..b93efdd 100644 --- a/server/src/main/resources/application.yml +++ b/server/src/main/resources/application.yml @@ -26,6 +26,24 @@ spring: config: import: "optional:configserver:" + application: + name: monitoring + +management: + endpoint: + metrics: + enabled: true + prometheus: + enabled: true + + endpoints: + web: + exposure: + include: health, info, metrics, prometheus + + metrics: + tags: + application: ${spring.application.name} jasypt: encryptor: