Add docker_sd job

This commit is contained in:
Joey Hafner 2022-07-08 01:18:17 -07:00
parent d7eaa943c7
commit 1abf602e1c
2 changed files with 12 additions and 11 deletions

View File

@ -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

View File

@ -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
#