-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpromtail-config.yaml
31 lines (27 loc) · 1.04 KB
/
promtail-config.yaml
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
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://${LOKI_HOSTNAME}:${LOKI_PORT}/loki/api/v1/push
scrape_configs:
- job_name: prediction-service-logs
docker_sd_configs:
- host: unix:///var/run/docker.sock
refresh_interval: 15s
filters:
- name: label
# we may need to update this now that this is not deployed on the manager node (maybe filter by container name)
values: ["com.docker.swarm.service.name=${SERVICE_NAME_OF_INTEREST}"]
# Clean up the container name (https://community.grafana.com/t/add-container-name-to-promtail-docker-logs/58572/5)
relabel_configs:
- source_labels: ['__meta_docker_container_name']
regex: '/(.*)'
target_label: 'service'
- source_labels: ['__meta_docker_container_name']
regex: '/(.*)\.[0-9]\..*'
target_label: 'service'
- source_labels: ['__meta_docker_container_name']
regex: '/(.*)\.[0-9a-z]*\..*'
target_label: 'service'