From 2bae25284c5b541cbb731d2e978f1b1a07e76d59 Mon Sep 17 00:00:00 2001 From: Alex Frantz Date: Tue, 29 Jul 2025 23:47:29 -0400 Subject: [PATCH] pull in prometheus config --- tasks/monitoring.yml | 5 +++++ templates/prometheus.yml.j2 | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 templates/prometheus.yml.j2 diff --git a/tasks/monitoring.yml b/tasks/monitoring.yml index 919c6da..ffd2e4e 100644 --- a/tasks/monitoring.yml +++ b/tasks/monitoring.yml @@ -26,6 +26,11 @@ env: GF_AUTH_ANONYMOUS_ENABLED: "{{ GRAFANA_AUTH_ANONYMOUS_ENABLED }}" +- name: Copy Prometheus Config + template: + src: "prometheus.yml.j2" + dest: "{{ data_dir }}/monitoring/prometheus/prometheus.yml" + - name: Create Prometheus Docker Container docker_container: name: prometheus diff --git a/templates/prometheus.yml.j2 b/templates/prometheus.yml.j2 new file mode 100644 index 0000000..5b8b75f --- /dev/null +++ b/templates/prometheus.yml.j2 @@ -0,0 +1,19 @@ +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + # Prometheus itself + - job_name: "prometheus" + static_configs: + - targets: ["localhost:9090"] + + # Node Exporter (system metrics) + - job_name: "node-exporter" + static_configs: + - targets: ["node-exporter:9100"] + + # Docker metrics + - job_name: "cadvisor" + static_configs: + - targets: ["cadvisor:8083"] \ No newline at end of file