1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/promtail/templates/promtail.yaml.j2
Kristian Klausen 563c3c5c19
loki/promtail: Use a bearer token instead of basic auth
It simplifies it a bit.
2021-07-08 02:58:58 +02:00

60 lines
1.5 KiB
Django/Jinja

server:
http_listen_address: {{ wireguard_address }}
http_listen_port: 9080
grpc_listen_address: 127.0.0.1
grpc_listen_port: 0 # 0 means random
positions:
filename: /var/lib/promtail/positions.yaml
clients:
- url: http://{{ hostvars['monitoring.archlinux.org']['wireguard_address'] }}/loki/api/v1/push
bearer_token: '{{ vault_loki_token }}'
scrape_configs:
- job_name: journal
journal:
json: true
max_age: 72h
path: /var/log/journal
labels:
job: systemd-journal
relabel_configs:
- source_labels: ["__journal__hostname"]
target_label: instance
- job_name: nginx
static_configs:
- targets:
- localhost
labels:
job: nginx
instance: {{ ansible_fqdn }}
__path__: /var/log/nginx/*/*.json
pipeline_stages:
- match:
selector: '{job="nginx"}'
stages:
- json:
expressions:
time_local: time_local
- timestamp:
format: 02/Jan/2006:15:04:05 -0700
source: time_local
- job_name: pacman
static_configs:
- targets:
- localhost
labels:
job: pacman
instance: {{ ansible_fqdn }}
__path__: /var/log/pacman.log
pipeline_stages:
- match:
selector: '{job="pacman"}'
stages:
- regex:
expression: '^\[(?P<timestamp>.*?)\]'
- timestamp:
format: 2006-01-02T15:04:05Z0700
source: timestamp