diff --git a/docker-compose.yml b/docker-compose.yml index cf4525a..843a208 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -374,8 +374,12 @@ services: nginx-exporter: image: nginx/nginx-prometheus-exporter:latest command: - - -nginx.scrape-uri=http://127.0.0.1:8888/nginx_status - network_mode: host + - -nginx.scrape-uri=http://host.docker.internal:8888/nginx_status + - -nginx.timeout=5s + extra_hosts: + - "host.docker.internal:host-gateway" + ports: + - "127.0.0.1:9113:9113" restart: unless-stopped blackbox-exporter: diff --git a/monitoring/prometheus.yml b/monitoring/prometheus.yml index c93914f..a788af8 100644 --- a/monitoring/prometheus.yml +++ b/monitoring/prometheus.yml @@ -42,7 +42,7 @@ scrape_configs: # ── nginx ────────────────────────────────────────────────────────── - job_name: nginx static_configs: - - targets: ["host.docker.internal:9113"] + - targets: ["nginx-exporter:9113"] # ── Blackbox probes (HTTP endpoint monitoring) ───────────────────── - job_name: blackbox_http