diff --git a/docker-compose.yml b/docker-compose.yml index 2285d25..cf4525a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -298,6 +298,8 @@ services: - --config.file=/etc/prometheus/prometheus.yml - --storage.tsdb.retention.time=90d - --web.enable-lifecycle + extra_hosts: + - "host.docker.internal:host-gateway" restart: unless-stopped grafana: @@ -372,9 +374,8 @@ services: nginx-exporter: image: nginx/nginx-prometheus-exporter:latest command: - - -nginx.scrape-uri=http://host.docker.internal:8888/nginx_status - extra_hosts: - - "host.docker.internal:host-gateway" + - -nginx.scrape-uri=http://127.0.0.1:8888/nginx_status + network_mode: host restart: unless-stopped blackbox-exporter: diff --git a/monitoring/prometheus.yml b/monitoring/prometheus.yml index a788af8..c93914f 100644 --- a/monitoring/prometheus.yml +++ b/monitoring/prometheus.yml @@ -42,7 +42,7 @@ scrape_configs: # ── nginx ────────────────────────────────────────────────────────── - job_name: nginx static_configs: - - targets: ["nginx-exporter:9113"] + - targets: ["host.docker.internal:9113"] # ── Blackbox probes (HTTP endpoint monitoring) ───────────────────── - job_name: blackbox_http