Skip to content

Commit

Permalink
fix(promtail): label journal jobs with host name
Browse files Browse the repository at this point in the history
Closed #60

Closed #59

Signed-off-by: Bruce Becker <brucellino@protonmail.com>
  • Loading branch information
brucellino committed Oct 14, 2023
1 parent 1fe5c76 commit eeb34d8
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions monitoring/templates/promtail.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,33 @@ clients:
- url: http://localhost:9999/loki/loki/api/v1/push

scrape_configs:
- job_name: consul
static_configs:
- targets:
- localhost
labels:
job: consul
__path__: /home/consul/*.log
- job_name: nomad
static_configs:
- targets:
- localhost
labels:
job: nomad
__path__: /var/log/nomad*.log
- job_name: journal
journal:
max_age: 12h
path: /var/log/journal
matches: _TRANSPORT
labels:
job: systemd-journal
relabel_configs:
- source_labels: ['__journal__systemd_unit']
target_label: 'unit'
- source_labels: ['__journal_syslog_identifier']
target_label: 'syslog_identifier'
- job_name: consul
static_configs:
- targets:
- localhost
labels:
job: consul
__path__: /home/consul/*.log
- job_name: nomad
static_configs:
- targets:
- localhost
labels:
job: nomad
__path__: /var/log/nomad*.log
- job_name: journal
journal:
json: false
max_age: 12h
path: /var/log/journal
matches: _TRANSPORT=kernel
labels:
job: systemd-journal
relabel_configs:
- source_labels: ['__journal__systemd_unit']
target_label: 'unit'
- source_labels: ['__journal_syslog_identifier']
target_label: 'syslog_identifier'
- source_labels:
- __journal__hostname
target_label: nodename

0 comments on commit eeb34d8

Please sign in to comment.