-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.logging-loki-plugin.yml
47 lines (38 loc) · 1.19 KB
/
docker-compose.logging-loki-plugin.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
version: "3"
x-logging-config:
&logging-config
logging:
# A docker plugin is necessary for loki to work correctly (if not done you get : plugin "loki" not found):
# $ docker plugin install grafana/loki-docker-driver:latest --alias loki --grant-all-permissions
driver: loki
options:
loki-url: http://${LOKI_HOST:-localhost:9092}/loki/api/v1/push
loki-retries: "5"
loki-external-labels: 'environment=${ENV_TYPE:-unknown},container_name={{.Name}}'
loki-relabel-config: |
- action: labelmap
regex: compose_service
replacement: job
services:
promtail:
image: grafana/promtail:2.4.1
volumes:
- ./promtail/config.yml:/etc/promtail/config.yml
- ./docker-data/pipelines/log:/var/log/pipelines
network_mode: host
environment:
LOKI_HOST: "${LOKI_HOST:-localhost:9092}"
ENV_TYPE: "${ENV_TYPE:-unknown}"
command: -config.expand-env=true -config.file=/etc/promtail/config.yml -print-config-stderr
back:
<<: *logging-config
front:
<<: *logging-config
pipelines:
<<: *logging-config
nginx:
<<: *logging-config
postgres:
<<: *logging-config
adminer:
<<: *logging-config