diff --git a/homelab/server/config/monitoring/docker-compose.yml b/homelab/server/config/monitoring/docker-compose.yml index 784bfe2b..057d94c8 100644 --- a/homelab/server/config/monitoring/docker-compose.yml +++ b/homelab/server/config/monitoring/docker-compose.yml @@ -59,6 +59,7 @@ services: - monitoring volumes: - /var/lib/docker/containers:/var/lib/docker/containers + - /var/run/docker.sock:/var/run/docker.sock - ${DOCKER_DATA}/promtail:/etc/promtail - ./promtail-config.yml:/etc/promtail/promtail-config.yml # not sure if this works. If not, just edit the config within the data volume restart: unless-stopped diff --git a/homelab/server/config/monitoring/promtail-config.yml b/homelab/server/config/monitoring/promtail-config.yml index 7be0e3cc..36eeffd8 100644 --- a/homelab/server/config/monitoring/promtail-config.yml +++ b/homelab/server/config/monitoring/promtail-config.yml @@ -17,17 +17,17 @@ scrape_configs: job: docker __path__: /var/lib/docker/containers/*/*-json.log - # - job_name: docker - # docker_sd_configs: - # - host: unix:///var/run/docker.sock - # refresh_interval: 5s - # filters: - # - name: name - # values: [flog] - # relabel_configs: - # - source_labels: ['__meta_docker_container_name'] - # regex: '/(.*)' - # target_label: 'container' + - job_name: docker_sd + docker_sd_configs: + - host: unix:///var/run/docker.sock + refresh_interval: 5s + filters: + - name: name + values: [flog] + relabel_configs: + - source_labels: ['__meta_docker_container_name'] + regex: '/(.*)' + target_label: 'container' # local machine logs #