From e45ead73669fb081994e7597c416d582741def07 Mon Sep 17 00:00:00 2001 From: uykhc Date: Tue, 5 May 2026 20:34:50 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20prometheus=20=EB=AA=A8=EB=8B=88?= =?UTF-8?q?=ED=84=B0=EB=A7=81=20=EC=84=A4=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Spring Boot Actuator 및 Micrometer Prometheus registry 의존성 추가 - docker-compose.dev에 prometheus 서비스/볼륨 구성 추가 - management endpoint 노출 범위에 info, metrics, prometheus 추가 --- build.gradle.kts | 5 ++++- docker-compose.dev.yml | 17 +++++++++++++++++ src/main/resources/application.yaml | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index cfebb3cb..5b8d2200 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -44,7 +44,6 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-webflux") implementation("org.springframework.boot:spring-boot-starter-data-jdbc") implementation("org.springframework.boot:spring-boot-starter-data-redis") - implementation("org.springframework.boot:spring-boot-starter-actuator") implementation("org.springframework.boot:spring-boot-starter-mail") implementation("org.mindrot:jbcrypt:0.4") implementation("io.jsonwebtoken:jjwt-api:0.11.5") @@ -73,6 +72,10 @@ dependencies { // OCI Vault - SDK 직접 사용 (waffle-oci-vault 2.1.0은 Spring Boot 3.5와 호환 안됨) implementation("com.oracle.oci.sdk:oci-java-sdk-secrets:3.80.1") implementation("com.oracle.oci.sdk:oci-java-sdk-common-httpclient-jersey3:3.80.1") + + // prometheus 의존성 추가 + implementation("org.springframework.boot:spring-boot-starter-actuator") + implementation("io.micrometer:micrometer-registry-prometheus") } kotlin { diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 99b4dc2e..b723e04d 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -76,6 +76,23 @@ services: limits: memory: 64M + prometheus: + image: prom/prometheus:latest + container_name: prometheus-dev + restart: unless-stopped + ports: + - "127.0.0.1:9090:9090" + volumes: + - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro + - prometheus_data_dev:/prometheus + command: + - "--config.file=/etc/prometheus/prometheus.yml" + - "--storage.tsdb.path=/prometheus" + depends_on: + app: + condition: service_healthy + volumes: mysql_data_dev: redis_data_dev: + prometheus_data_dev: diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 473a1ff9..ee7ef521 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -68,7 +68,7 @@ management: endpoints: web: exposure: - include: health + include: health,info,prometheus,metrics endpoint: health: show-details: always