Skip to content

Instantly share code, notes, and snippets.

@illiafox
Last active March 1, 2025 10:02
Show Gist options
  • Save illiafox/9c62804b5992e82a254fb6411148a0b2 to your computer and use it in GitHub Desktop.
Save illiafox/9c62804b5992e82a254fb6411148a0b2 to your computer and use it in GitHub Desktop.
Promtail Read Docker Logs
server:
http_listen_port: 10080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: "http://localhost:9428/insert/loki/api/v1/push"
scrape_configs:
- job_name: containers
docker_sd_configs:
- host: unix:///var/run/docker.sock
refresh_interval: 15s
pipeline_stages:
- docker: {}
- static_labels:
job: "containers_logs"
relabel_configs:
- source_labels: ['__meta_docker_container_name']
regex: '/(.*)'
target_label: 'container'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment