-
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
Collapse multiline logs based on a start line. #3024
Conversation
Summary: This is a very simple approach based on grafana#1380 to provide multiline or block log entries in promtail. A `multiline` stage is added to pipelines. This stages matches a start line. Once a start line is matched all following lines are appended to an entry and not passed on to downstream stages. Once a new start line is matched the former block of multilines is sent. If now new line arrives withing `max_wait_time` the block is flushed to the next stage and a new block is started.
Codecov Report
@@ Coverage Diff @@
## master #3024 +/- ##
==========================================
- Coverage 62.63% 62.59% -0.04%
==========================================
Files 185 186 +1
Lines 15731 15822 +91
==========================================
+ Hits 9853 9904 +51
- Misses 4956 4992 +36
- Partials 922 926 +4
|
Co-authored-by: Cyril Tovena <cyril.tovena@gmail.com>
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.
LGTM Great work @jeschkies
I know some folks that will be happy !
There's one last comment before we merge, about logging.
EDIT: and the mess I made with the func :p
Wow, great work @jeschkies 🥇 |
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.
A bit late on my review, but LGTM.
The one area I think we're lacking to address is log files which have many different structures (where the firstline
concept feels a bit lacking). Not something we need to solve now though.
Summary:
This is a very simple approach based on #1380 to provide multiline
or block log entries in promtail.
A
multiline
stage is added to pipelines. This stages matches a startline. Once a start line is matched all following lines are appended
to an entry and not passed on to downstream stages. Once a new start
line is matched the former block of multilines is sent.
If no new line arrives within
max_wait_time
the block is flushed tothe next stage and a new block is started.
If a block exceeds
max_lines
it is flushed as well.Which issue(s) this PR fixes:
Resolves #74
Checklist