Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promtail config for journald logging, Podman considerations #112

Closed
CJLove opened this issue Jan 9, 2022 · 0 comments
Closed

Promtail config for journald logging, Podman considerations #112

CJLove opened this issue Jan 9, 2022 · 0 comments

Comments

@CJLove
Copy link

CJLove commented Jan 9, 2022

Hi Tim,

This has been a fantastic resource for getting grafana/loki deployed in my environment! Many thanks!

Fedora doesn't configure journald to log files under /var/log so an additional job in the promtail-config.yml may be needed to scrape the journal files:

- job_name: journal
  journal:
    max_age: 12h
    labels:
      job: systemd-journal
    path: /var/log/journal
  relabel_configs:
    - source_labels: ['__journal__systemd_unit']
      target_label: 'unit'
    - source_labels: ['__journal__hostname']
      target_label: 'hostname'

This also adds the "hostname" label so you can distinguish if you've got multiple hosts sending journald logs to loki.

There are additional volumes to pass into the promtail container as well:

/run/log/journal:/run/log/journal
/etc/machine-id:/etc/machine-id

For those trying to do this with Podman on Fedora I found that loki and grafana can be run as non-root user in a pod with promtail running separately as root, using the public loki port.

@techno-tim techno-tim locked and limited conversation to collaborators Jan 9, 2022
@timothystewart6 timothystewart6 converted this issue into discussion #113 Jan 9, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant