From 975e03b7bd583aaea90b4839148524040bb4d74c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=86=90=EC=B0=BD=ED=98=84?= Date: Wed, 10 Aug 2022 14:42:41 +0900 Subject: [PATCH] add: prometheus (#92) --- server/build.gradle.kts | 2 ++ server/src/main/resources/application-prod.yml | 4 ++++ server/src/main/resources/application.yml | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+) 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: