From 4cd10e3fbd31332be017c1bfaffcd3138ef589f5 Mon Sep 17 00:00:00 2001 From: ThinkKat Date: Thu, 26 Feb 2026 21:11:15 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Prometheus=20=EB=A9=94=ED=8A=B8?= =?UTF-8?q?=EB=A6=AD=20+=20load-test=20=ED=8C=8C=EC=9D=BC=20=EB=A1=9C?= =?UTF-8?q?=EA=B9=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - micrometer-registry-prometheus 의존성 추가 → /actuator/prometheus 엔드포인트 활성화 - logback-spring.xml: load-test 프로파일도 FILE appender 사용 (Alloy 수집용) - application-prod.yml, application-load-test.yml: prometheus endpoint 노출 + metrics tags --- build.gradle | 3 +++ src/main/resources/application-prod.yml | 6 +++++- src/main/resources/logback-spring.xml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index f10d70e..ee91a56 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,9 @@ dependencies { runtimeOnly 'org.postgresql:postgresql' runtimeOnly 'com.h2database:h2' + // Metrics + runtimeOnly 'io.micrometer:micrometer-registry-prometheus' + // Logging implementation 'net.logstash.logback:logstash-logback-encoder:7.4' diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 85201cf..af4a01d 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -32,10 +32,14 @@ management: endpoints: web: exposure: - include: "health" + include: "health,prometheus" endpoint: health: show-details: never + metrics: + tags: + application: opic-practice + env: production logging: file: diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index f2e1259..8fb454b 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -2,7 +2,7 @@ - + ${LOG_PATH}/${LOG_FILE_NAME}.log