infra/roles/monitoring/templates/promtail.yml
2024-01-17 16:48:39 -08:00

29 lines
627 B
YAML

server:
log_level: warn
http_listen_port: 0
grpc_listen_port: 0
clients:
- url: https://logs.janky.solutions
external_labels:
hostname: "{{ inventory_hostname }}"
scrape_configs:
- job_name: journald
journal:
labels:
job: systemd-label
relabel_configs:
- source_labels: ['__journal__systemd_unit']
target_label: 'unit'
{% if 'jobs' in logs %}
{% for job_name, path in logs.jobs.items() %}
- job_name: {{ job_name }}
static_configs:
- targets:
- localhost
labels:
job: {{ job_name }}
__path__: {{ path }}
{% endfor %}
{% endif %}