diff --git a/homelab/server/config/monitoring/docker-compose.yml b/homelab/server/config/monitoring/docker-compose.yml index 95ddc49c..784bfe2b 100644 --- a/homelab/server/config/monitoring/docker-compose.yml +++ b/homelab/server/config/monitoring/docker-compose.yml @@ -58,7 +58,7 @@ services: networks: - monitoring volumes: - - /var/run/docker.sock:/var/run/docker.sock + - /var/lib/docker/containers:/var/lib/docker/containers - ${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 3a8d8c29..7be0e3cc 100644 --- a/homelab/server/config/monitoring/promtail-config.yml +++ b/homelab/server/config/monitoring/promtail-config.yml @@ -10,16 +10,24 @@ clients: scrape_configs: - 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' + pipeline_stages: + - docker: {} + static_configs: + - labels: + 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' # local machine logs #