From 2fe576546fce43f942ff5faf51e35c52a1389313 Mon Sep 17 00:00:00 2001 From: mo124121 <101929016+mo124121@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:29:31 +0900 Subject: [PATCH] prometheus Fixes #4 --- docker-compose.yaml | 12 ++++++++++++ prometheus/.gitignore | 1 + prometheus/prometheus.yml | 13 +++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 prometheus/.gitignore create mode 100644 prometheus/prometheus.yml diff --git a/docker-compose.yaml b/docker-compose.yaml index 8a04499..1829ae0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -19,3 +19,15 @@ services: - "9000:9000" volumes: - "./pprotein/data:/data/data" + + prometheus: + image: prom/prometheus + container_name: prometheus + volumes: + - ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml + - ./prometheus/data:/prometheus + ports: + - "9090:9090" + command: + - "--config.file=/etc/prometheus/prometheus.yml" + - "--storage.tsdb.path=/prometheus" diff --git a/prometheus/.gitignore b/prometheus/.gitignore new file mode 100644 index 0000000..1269488 --- /dev/null +++ b/prometheus/.gitignore @@ -0,0 +1 @@ +data diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml new file mode 100644 index 0000000..53165b6 --- /dev/null +++ b/prometheus/prometheus.yml @@ -0,0 +1,13 @@ +global: + scrape_interval: 10s + +scrape_configs: + - job_name: "node_exporter" + static_configs: + - targets: + ["isucon-server1:9100", "isucon-server2:9100", "isucon-server3:9100"] + + - job_name: "process_exporter" + static_configs: + - targets: + ["isucon-server1:9256", "isucon-server2:9256", "isucon-server3:9256"]