-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
fix(promtail): Fix cri tags extra new lines. #7997
Conversation
When re-creating single lines from multiple partial lines, `\n` should be avoided to join the partial lines. Related: #6177 (comment) Fixes: #7996 Signed-off-by: Kaviraj <[email protected]>
Signed-off-by: Kaviraj <[email protected]>
./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.
This looks good. I'm concerned about the spacing, though.
@@ -107,50 +107,33 @@ func TestCRI_tags(t *testing.T) { | |||
{ | |||
name: "tag P", | |||
lines: []string{ | |||
"2019-05-07T18:57:50.904275087+00:00 stdout P partial line 1", | |||
"2019-05-07T18:57:50.904275087+00:00 stdout P partial line 2", | |||
"2019-05-07T18:57:50.904275087+00:00 stdout P partial line 1 ", |
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.
Do partial lines come in with a space at the end or should we be joining with " "
?
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.
I don't think we have to handle the spaces here, cri will just split without any adding any extra characters. We should join as it is.
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.
Ok, it looks like cri-o splits lines wherever. Thanks!
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
@@ -107,50 +107,33 @@ func TestCRI_tags(t *testing.T) { | |||
{ | |||
name: "tag P", | |||
lines: []string{ | |||
"2019-05-07T18:57:50.904275087+00:00 stdout P partial line 1", | |||
"2019-05-07T18:57:50.904275087+00:00 stdout P partial line 2", | |||
"2019-05-07T18:57:50.904275087+00:00 stdout P partial line 1 ", |
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.
Ok, it looks like cri-o splits lines wherever. Thanks!
What this PR does / why we need it:
When re-creating single lines from multiple partial lines,
\n
should be avoided to join the partial lines.Related: #6177 (comment)
Example
if Original log line is
And got split into partial lines via CRI
The result should be without \n when joining both of those lines.
Signed-off-by: Kaviraj [email protected]
Which issue(s) this PR fixes:
Fixes: #7996
Special notes for your reviewer:
Checklist
CONTRIBUTING.md
guideCHANGELOG.md
updated