Promtail
This commit is contained in:
parent
fdbdfcd93d
commit
487aef6c87
19
promtail-agent/docker-compose.yml
Normal file
19
promtail-agent/docker-compose.yml
Normal file
@ -0,0 +1,19 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
promtail:
|
||||
image: grafana/promtail:latest
|
||||
container_name: promtail
|
||||
logging:
|
||||
driver: journald
|
||||
options:
|
||||
mode: non-blocking
|
||||
environment:
|
||||
- TZ=America/Chicago
|
||||
volumes:
|
||||
- /opt/logs:/opt/logs:ro # docker
|
||||
- /var/log:/var/log:ro # varlogs
|
||||
- ./promtail:/etc/promtail
|
||||
- /etc/machine-id:/etc/machine-id:ro # journald logging
|
||||
restart: unless-stopped
|
||||
command: -config.file=/etc/promtail/promtail-config.yml
|
||||
37
promtail-agent/promtail/promtail-config.yml
Normal file
37
promtail-agent/promtail/promtail-config.yml
Normal file
@ -0,0 +1,37 @@
|
||||
server:
|
||||
http_listen_port: 9080
|
||||
grpc_listen_port: 0
|
||||
|
||||
positions:
|
||||
filename: /tmp/positions.yaml
|
||||
|
||||
clients:
|
||||
- url: http://192.168.60.8:3100/loki/api/v1/push
|
||||
|
||||
# local machine logs
|
||||
scrape_configs:
|
||||
- job_name: system
|
||||
pipeline_stages:
|
||||
- job_name: journal
|
||||
journal:
|
||||
max_age: 12h
|
||||
labels:
|
||||
job: systemd-journal
|
||||
relabel_configs:
|
||||
- source_labels: ["__journal__systemd_unit"]
|
||||
target_label: "unit"
|
||||
- source_labels: ["__journal_container_name"]
|
||||
target_label: "container"
|
||||
static_configs:
|
||||
- targets:
|
||||
- localhost
|
||||
labels:
|
||||
job: varlogs
|
||||
__path__: /var/log/**/**log
|
||||
- targets:
|
||||
- localhost
|
||||
labels:
|
||||
job: containers
|
||||
__path__: /opt/logs/**/*log # internal container logs
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user