From dfa675f414f0f1aab8de0f5d4398abaf10684195 Mon Sep 17 00:00:00 2001 From: YeaChan05 Date: Thu, 6 Jun 2024 16:37:49 +0900 Subject: [PATCH] =?UTF-8?q?[ci]=20mysql=20exporter=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mysql exporter 수정 --- docker-compose.yml | 12 ++++++++++-- prometheus.yml | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index a82f3f311..da59e9d03 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -59,14 +59,20 @@ services: restart: always ports: - "6379:6379" + volumes: + - redis-data:/data + prometheus: image: prom/prometheus container_name: prometheus restart: always volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml + - prometheus-data:/prometheus ports: - "9090:9090" + extra_hosts: + - "host.docker.internal:host-gateway" grafana: image: grafana/grafana @@ -80,7 +86,7 @@ services: - grafana-storage:/var/lib/grafana mysqld_exporter: - image: prom/mysqld_exporter + image: prom/mysqld-exporter restart: always environment: - DATA_SOURCE_NAME=${MYSQL_USERNAME}:${MYSQL_PASSWORD}@tcp(${MYSQL_HOST})/ @@ -88,4 +94,6 @@ services: - "9104:9104" volumes: - grafana-storage: \ No newline at end of file + grafana-storage: + prometheus-data: + redis-data: diff --git a/prometheus.yml b/prometheus.yml index ecb803232..7f3e4e17a 100644 --- a/prometheus.yml +++ b/prometheus.yml @@ -9,7 +9,8 @@ scrape_configs: - job_name: 'spring-boot-apps' static_configs: - targets: ['app1:8080', 'app2:8080', 'app3:8080'] + metrics_path: '/actuator/prometheus' - job_name: 'mysql' static_configs: - - targets: ['mysqld_exporter:9104'] \ No newline at end of file + - targets: ['mysqld_exporter:9104']