Switch back to TechnoTim's log scraping method

This commit is contained in:
Joey Hafner 2022-07-08 01:09:35 -07:00
parent 3ed05ae45d
commit d7eaa943c7
2 changed files with 19 additions and 11 deletions

View File

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

View File

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