From 1ccea1de1c4f699ba4b5dc6898e4c516f4c8b7b5 Mon Sep 17 00:00:00 2001 From: GaBaljaintheroom Date: Tue, 21 Nov 2023 15:08:51 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20grafana,=20prometheus=20=EB=8F=84?= =?UTF-8?q?=EC=BB=A4=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.prod.yml | 27 +++++++++++++++++++++++++++ prometheus/grafana.ini | 4 ++++ prometheus/prometheus.yml | 14 ++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 prometheus/grafana.ini create mode 100644 prometheus/prometheus.yml diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index cb1f021..756526a 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -132,6 +132,33 @@ services: networks: - aiary + prometheus: + image: prom/prometheus:latest + container_name: prometheus + volumes: + - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + restart: unless-stopped + ports: + - 9090:9090 + networks: + - aiary + + grafana: + image: grafana/grafana:latest + container_name: grafana + volumes: + - ./backend-spring/data/grafana:/var/lib/grafana + - ./prometheus/grafana.ini:/etc/grafana/grafana.ini + restart: unless-stopped + ports: + - 3030:3030 + depends_on: + - prometheus + env_file: + - ./prometheus/grafana.env + networks: + - aiary + networks: aiary: driver: bridge diff --git a/prometheus/grafana.ini b/prometheus/grafana.ini new file mode 100644 index 0000000..cb3fa73 --- /dev/null +++ b/prometheus/grafana.ini @@ -0,0 +1,4 @@ +[server] +domain = grafana +root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/ +serve_from_sub_path = true diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml new file mode 100644 index 0000000..4402e9e --- /dev/null +++ b/prometheus/prometheus.yml @@ -0,0 +1,14 @@ +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + - job_name: "prometheus" + static_configs: + - targets: ['prometheus:9090'] + + - job_name: 'backend' + scrape_interval: 5s + metrics_path: '/api/actuator/prometheus' + static_configs: + - targets: ['backend:8080'] \ No newline at end of file