infra/roles/monitoring/templates/promtail.yml

30 lines
661 B
YAML
Raw Permalink Normal View History

2024-01-17 17:45:49 +00:00
server:
log_level: warn
2024-02-18 02:26:24 +00:00
http_listen_port: 9080
2024-01-17 17:45:49 +00:00
grpc_listen_port: 0
clients:
- url: http://10.5.1.211:3100/loki/api/v1/push
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 logs is defined and 'jobs' in logs %}
2024-01-17 17:45:49 +00:00
{% for job_name, path in logs.jobs.items() %}
- job_name: {{ job_name }}
static_configs:
- targets:
- localhost
labels:
job: {{ job_name }}
__path__: {{ path }}
{% endfor %}
{% endif %}