Skip to content

[logs] Aggregates long lines when tailing in a k8s env - part #2#6266

Merged
prognant merged 1 commit intomasterfrom
prognant/aggregates-long-lines-k8s-file-tailing-part2
Sep 18, 2020
Merged

[logs] Aggregates long lines when tailing in a k8s env - part #2#6266
prognant merged 1 commit intomasterfrom
prognant/aggregates-long-lines-k8s-file-tailing-part2

Conversation

@prognant
Copy link
Copy Markdown
Contributor

@prognant prognant commented Aug 20, 2020

What does this PR do?

Enable buffering+concatenation for split lines.
Useful in k8s env when tailing from file (logs_config.k8s_container_use_file: true)

Motivation

Get entire log line show in log explorer when lines are longer tha 16kB.

Additional Notes

Depends on #6265

Describe your test plan

UT
IRL tests : agent running in k8s with different container runtime (at least containerd and docker) and logs_config.k8s_container_use_file: true :

  • minikube + docker ✅
  • minikube + containerd ✅

@prognant prognant added do-not-merge/WIP [deprecated] team/agent-core Deprecated. Use metrics-logs / shared-components labels instead.. changelog/no-changelog No changelog entry needed labels Aug 20, 2020
@prognant prognant added this to the 7.23.0 milestone Aug 20, 2020
@prognant prognant requested review from a team as code owners August 20, 2020 11:05
@prognant prognant changed the title [WIP][logs] aggregated split lines while tailing from file in k8s env [WIP][logs] Aggregates long lines when tailing in a k8s env - part #2 Aug 21, 2020
@prognant prognant force-pushed the prognant/aggregates-long-lines-k8s-file-tailing branch from 5164e89 to 262d561 Compare August 25, 2020 15:28
@prognant prognant force-pushed the prognant/aggregates-long-lines-k8s-file-tailing-part2 branch from 48c13d7 to 2aee6df Compare August 25, 2020 15:59
@prognant prognant changed the title [WIP][logs] Aggregates long lines when tailing in a k8s env - part #2 [logs] Aggregates long lines when tailing in a k8s env - part #2 Aug 26, 2020
@prognant prognant force-pushed the prognant/aggregates-long-lines-k8s-file-tailing branch from 262d561 to 10b9ae7 Compare August 28, 2020 15:34
@prognant prognant force-pushed the prognant/aggregates-long-lines-k8s-file-tailing-part2 branch from e9f2c9c to 74cb382 Compare August 28, 2020 15:35
Copy link
Copy Markdown
Contributor

@ogaca-dd ogaca-dd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, few comments.

Comment thread pkg/logs/decoder/line_handler.go
if err != nil {
log.Debug(err)
}
// track the raw data length and the timestamp so that the agent tails
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to continue the execution of the code when err != nill?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to kept the behaviour consistent with the current one, I think that's ok to attempt to send the line even if the parsing fails. But on the other hand having the parsing logic failing almost silently may not be a good idea after all... I'll try to think about an alternate solution.

Comment thread pkg/logs/decoder/line_parser.go
Comment thread pkg/logs/decoder/line_parser.go
@prognant prognant force-pushed the prognant/aggregates-long-lines-k8s-file-tailing branch from 10b9ae7 to 19d6b97 Compare September 2, 2020 09:29
@prognant prognant force-pushed the prognant/aggregates-long-lines-k8s-file-tailing-part2 branch from 74cb382 to 3417758 Compare September 2, 2020 09:59
@prognant prognant modified the milestones: 7.23.0, 7.24.0 Sep 18, 2020
@prognant prognant changed the base branch from prognant/aggregates-long-lines-k8s-file-tailing to master September 18, 2020 19:04
@prognant prognant force-pushed the prognant/aggregates-long-lines-k8s-file-tailing-part2 branch from 3417758 to 6f7d49a Compare September 18, 2020 22:18
@prognant prognant merged commit 48a7127 into master Sep 18, 2020
@prognant prognant deleted the prognant/aggregates-long-lines-k8s-file-tailing-part2 branch September 18, 2020 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog No changelog entry needed [deprecated] team/agent-core Deprecated. Use metrics-logs / shared-components labels instead..

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants