-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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: Add max-line-size
limit to drop on client side
#8153
Conversation
Currently the workaround is to depend only on the loki server side limits. This PR adds support in promtail to drop "too big" log lines. It also keep track of dropped lines in `promtail_dropped_entries` metrics with reason `max_line_size_limited`. Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
max-line-size
limit to drop on client side
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
5410119
to
5850cbd
Compare
./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
Co-authored-by: Christian Haudum <christian.haudum@gmail.com>
./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
…fana/loki into kavirajk/add-max-size-limit-promtail
./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise ok. Approved to unblock.
CHANGELOG.md
Outdated
@@ -26,7 +26,7 @@ | |||
* [8047](https://github.com/grafana/loki/pull/8047) **bboreham**: Dashboards: add k8s resource requests to CPU and memory panels. | |||
* [8061](https://github.com/grafana/loki/pull/8061) **kavirajk**: Remove circle from Loki OSS | |||
* [8131](https://github.com/grafana/loki/pull/8131) **jeschkies**: Compile Promtail ARM and ARM64 with journald support. | |||
|
|||
* [8153](https://github.com/grafana/loki/pull/8061) **kavirajk**: promtail: Add `max-line-size` limit to drop on client side |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move entry beneath # Promtail
section.
Hey! Thanks for the fast reaction on my issue. I think that the distributor's setting truncates the line at that size if it's greater, but does not drop it. Should we match this in promtail? In my case, I'd rather truncate it, but I see both choices are valid. |
The default behaviour is to drop it. It truncates only if Clarified that behaviour in the #8165. I'm happy to add |
**What this PR does / why we need it**: Add a clarrification of two flags `distributor.max-line-size` and `distributor.max-line-size-truncate`. And clarity on [discarding the logs](https://github.com/grafana/loki/blob/main/pkg/distributor/validator.go#L84-L92) if later is disabled while still former is set to non-zero values. Whereas if `distributor.max-line-size-truncate` is set, [log line is only truncated.](https://github.com/grafana/loki/blob/main/pkg/distributor/distributor.go#L517-L534) Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com> **Which issue(s) this PR fixes**: Fixes #NA **Special notes for your reviewer**: Figured while working on PR #8153 **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [x] Documentation added Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
./tools/diff_coverage.sh ../loki-target-branch/test_results.txt test_results.txt ingester,distributor,querier,querier/queryrange,iter,storage,chunkenc,logql,loki Change in test coverage per package. Green indicates 0 or positive change, red indicates that test coverage for a package fell. + ingester 0%
+ distributor 0%
+ querier 0%
+ querier/queryrange 0%
+ iter 0%
+ storage 0%
+ chunkenc 0%
+ logql 0%
+ loki 0% |
Great, thank you! Is there an issue to follow this? Also, lmk if you can't find time to do that, I could submit a PR. |
…8165) **What this PR does / why we need it**: Add a clarrification of two flags `distributor.max-line-size` and `distributor.max-line-size-truncate`. And clarity on [discarding the logs](https://github.com/grafana/loki/blob/main/pkg/distributor/validator.go#L84-L92) if later is disabled while still former is set to non-zero values. Whereas if `distributor.max-line-size-truncate` is set, [log line is only truncated.](https://github.com/grafana/loki/blob/main/pkg/distributor/distributor.go#L517-L534) Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com> **Which issue(s) this PR fixes**: Fixes #NA **Special notes for your reviewer**: Figured while working on PR grafana#8153 **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [x] Documentation added Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Follow up from #8153 Changes: * Change type of the flag from `int` to `flagext.ByteSize` (to be consistent with similar flag in `distributor`) * Add doc to promtail config page * Fix changelog entries Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com> **What this PR does / why we need it**: Follow up from #8153 Changes: * Change type of the flag from `int` to `flagext.ByteSize` (to be consistent with similar flag in `distributor`) * Add doc to promtail config page * Fix changelog entries **Which issue(s) this PR fixes**: Fixes #NA **Special notes for your reviewer**: **Checklist** - [x] Reviewed the [`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md) guide (**required**) - [x] Documentation added - [x] `CHANGELOG.md` updated Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
What this PR does / why we need it:
promtail: Add max-line-size limit to drop on client side
Currently the workaround is to depend only on the loki server side limits.
This PR adds support in promtail to drop "too big" log lines. It also keep track of dropped lines in
promtail_dropped_entries
metric with reasonmax_line_size_limited
.Which issue(s) this PR fixes:
Fixes #8143
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guide (required)CHANGELOG.md
updated