Skip to content

Commit

Permalink
Skip ingester tailer filtering if no filter is set
Browse files Browse the repository at this point in the history
  • Loading branch information
pracucci authored and sandeepsukhani committed Sep 30, 2019
1 parent 3e0621e commit 42040f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/ingester/tailer.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,14 @@ func (t *tailer) send(stream logproto.Stream) {
}

func (t *tailer) filterEntriesInStream(stream *logproto.Stream) {
// Optimization: skip filtering entirely, if no filter is set
if t.filter == nil {
return
}

var filteredEntries []logproto.Entry
for _, e := range stream.Entries {
if t.filter == nil || t.filter([]byte(e.Line)) {
if t.filter([]byte(e.Line)) {
filteredEntries = append(filteredEntries, e)
}
}
Expand Down

0 comments on commit 42040f2

Please sign in to comment.