Skip to content

Commit

Permalink
Update journaltarget from loki/promtail
Browse files Browse the repository at this point in the history
  • Loading branch information
thampiotr committed Oct 29, 2024
1 parent b9632e6 commit 5ef994a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Main (unreleased)

- Fixed a bug in `import.git` which caused a `"non-fast-forward update"` error message. (@ptodev)

- Do not log error on clean shutdown of `loki.source.journal`. (@thampiotr)

### Other changes

- Small fix in UI stylesheet to fit more content into visible table area. (@defanator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

package target

// This code is copied from Promtail (https://github.com/grafana/loki/commit/954df433e98f659d006ced52b23151cb5eb2fdfa) with minor edits. The target package is used to
// configure and run the targets that can read journal entries and forward them
// This code is copied from Promtail (https://github.com/grafana/loki/blob/baaaa83c78c03c6b9257afddc0854daec928a755/clients/pkg/promtail/targets/journal/journaltarget.go#L4)
// with minor edits. The target package is used to configure and run the targets that can read journal entries and forward them
// to other loki components.

import (
Expand Down Expand Up @@ -214,7 +214,11 @@ func journalTargetWithReader(
for {
err := t.r.Follow(until, io.Discard)
if err != nil {
if err == sdjournal.ErrExpired || err == syscall.EBADMSG || err == io.EOF || strings.HasPrefix(err.Error(), "failed to iterate journal:") {
if err == sdjournal.ErrExpired {
return
}

if err == syscall.EBADMSG || err == io.EOF || strings.HasPrefix(err.Error(), "failed to iterate journal:") {
level.Error(t.logger).Log("msg", "unable to follow journal", "err", err.Error())
return
}
Expand Down

0 comments on commit 5ef994a

Please sign in to comment.