From fb24a47c1ae18a87d45e26bd46f128b557209e80 Mon Sep 17 00:00:00 2001 From: EunJiJung Date: Thu, 28 Nov 2024 03:20:27 +0900 Subject: [PATCH] =?UTF-8?q?feature/#173=20:=20prometheus=20=EC=84=B8?= =?UTF-8?q?=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: EunJiJung --- config/prometheus.yml | 21 +++++++++++++++++++ .../daon/onjung/core/constant/Constants.java | 6 +++++- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 config/prometheus.yml diff --git a/config/prometheus.yml b/config/prometheus.yml new file mode 100644 index 0000000..3b02fba --- /dev/null +++ b/config/prometheus.yml @@ -0,0 +1,21 @@ +global: + scrape_interval: 15s + +scrape_configs: + - job_name: 'api-server' + metrics_path: '/actuator/prometheus' + static_configs: + - targets: ['127.0.0.1:8080'] + + - job_name: 'bank' + metrics_path: '/actuator/prometheus' + static_configs: + - targets: ['127.0.0.1:8081'] + + - job_name: 'prometheus' + static_configs: + - targets: ['localhost:9090'] + + - job_name: 'jmeter' + static_configs: + - targets: ['127.0.0.1:9270'] # JMeter 플러그인을 통한 데이터 수집 \ No newline at end of file diff --git a/src/main/java/com/daon/onjung/core/constant/Constants.java b/src/main/java/com/daon/onjung/core/constant/Constants.java index b4240fd..5c88e9a 100644 --- a/src/main/java/com/daon/onjung/core/constant/Constants.java +++ b/src/main/java/com/daon/onjung/core/constant/Constants.java @@ -39,7 +39,11 @@ public class Constants { "/api-docs.html", "/api-docs/**", "/swagger-ui/**", - "/v3/**" + "/v3/**", + + // prometheus + "/actuator/", + "/actuator/**" ); /**