infra/roles/monitoring/templates/promtail.yml

30 lines
627 B
YAML
Raw Normal View History

2024-01-17 17:45:49 +00:00
server:
log_level: warn
http_listen_port: 0
grpc_listen_port: 0
clients:
2024-01-18 00:48:39 +00:00
- url: https://logs.janky.solutions
2024-01-17 17:45:49 +00:00
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 %}