Skip to content

Commit

Permalink
feat: Adds docker metrics to prometheus scraping
Browse files Browse the repository at this point in the history
Not working because custom networks (`monitoring`) cannot access use `host-gateway` to access the host machine: docker/for-linux#264 (comment) Solving requires attaching to default bridge network or doing some janky iptables stuff...
  • Loading branch information
NeedleInAJayStack committed Aug 31, 2024
1 parent 0320826 commit 97ae477
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ services:
restart: unless-stopped
networks:
- monitoring
extra_hosts:
- host.docker.internal:host-gateway
volumes:
- ./prometheus:/etc/prometheus
- prometheus_data:/prometheus
Expand Down
9 changes: 4 additions & 5 deletions docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ scrape_configs:
# # CREATE MANUALLY: Long-Lived Access Token
# credentials_file: "/etc/prometheus/homeassistant-credentials.txt"

# remote_write:
# - url: '<Your Prometheus remote_write endpoint>'
# basic_auth:
# username: '<Your Grafana Username>'
# password: '<Your Grafana API key>'
# See Ansible playbook for setup
- job_name: docker
static_configs:
- targets: ['host.docker.internal:9323']

0 comments on commit 97ae477

Please sign in to comment.