From 71b43c247a8cd692549d5c82e099ec8ed9ccbc2f Mon Sep 17 00:00:00 2001 From: hangillee Date: Tue, 26 Nov 2024 18:42:46 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20Prometheus,=20Grafana,=20Loki=20?= =?UTF-8?q?=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 --- backend/build.gradle | 6 +++++ backend/src/main/resources/application.yml | 4 ++- backend/src/main/resources/logback-spring.xml | 25 +++++++++++++++++-- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/backend/build.gradle b/backend/build.gradle index 377d7611..85d59fd0 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -63,6 +63,12 @@ dependencies { // flyway 추가 implementation 'org.flywaydb:flyway-mysql' + + // Prometheus + implementation 'io.micrometer:micrometer-registry-prometheus' + + // Loki + implementation 'com.github.loki4j:loki-logback-appender:1.5.2' } tasks.named('test') { diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml index 4c7dc183..a27c4260 100644 --- a/backend/src/main/resources/application.yml +++ b/backend/src/main/resources/application.yml @@ -26,10 +26,12 @@ management: enabled: true metrics: enabled: true + prometheus: + enabled: true endpoints: web: exposure: - include: info, health, metrics + include: prometheus, info, health, metrics base-path: ENC(zc5tP1eNIEjv3uN5Kuih7wlo5zILgWxq) enabled-by-default: false diff --git a/backend/src/main/resources/logback-spring.xml b/backend/src/main/resources/logback-spring.xml index 134165e8..5ae8e54d 100644 --- a/backend/src/main/resources/logback-spring.xml +++ b/backend/src/main/resources/logback-spring.xml @@ -1,8 +1,28 @@ - - + + + + + + + + + + + + ${LOKI_URL} + + + + + + @@ -72,6 +92,7 @@ +