Skip to content
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

Add missing Inc() to correctly increment the dropStage.dropCount metric on valid dropped log line; update related docs #4246

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clients/pkg/logentry/stages/drop.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (m *dropStage) Run(in chan Entry) chan Entry {
out <- e
continue
}
m.dropCount.WithLabelValues(*m.cfg.DropReason)
m.dropCount.WithLabelValues(*m.cfg.DropReason).Inc()
}
}()
return out
Expand Down
4 changes: 2 additions & 2 deletions docs/sources/clients/promtail/stages/drop.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ However it would _not_ drop this log line:

In this example the current time is 2020-08-12T12:00:00Z and `older_than` is 24h. All log lines which have a timestamp older than 2020-08-11T12:00:00Z will be dropped.

All lines dropped by this drop stage would also increment the `logentry_drop_lines_total` metric with a label `reason="line_too_old"`
All lines dropped by this drop stage would also increment the `logentry_dropped_lines_total` metric with a label `reason="line_too_old"`

#### Dropping long log lines

Expand All @@ -151,7 +151,7 @@ Given the pipeline:

Would drop any log line longer than 8kb bytes, this is useful when Loki would reject a line for being too long.

All lines dropped by this drop stage would also increment the `logentry_drop_lines_total` metric with a label `reason="line_too_long"`
All lines dropped by this drop stage would also increment the `logentry_dropped_lines_total` metric with a label `reason="line_too_long"`

### Complex drops

Expand Down
2 changes: 1 addition & 1 deletion docs/sources/clients/promtail/stages/match.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ label of `app` whose value is `pokey`. This does **not** match in our case, so
the nested `json` stage is not ran.

The fifth stage will drop any entries from the application `promtail` that matches
the regex `.*noisy error`. and will also increment the `logentry_drop_lines_total`
the regex `.*noisy error`. and will also increment the `logentry_dropped_lines_total`
metric with a label `reason="promtail_noisy_error"`

The final `output` stage changes the contents of the log line to be the value of
Expand Down