-
Notifications
You must be signed in to change notification settings - Fork 355
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
Implemented sending logs to systemd-journald #1975
Conversation
Signed-off-by: yihuaf <[email protected]>
Signed-off-by: yihuaf <[email protected]>
Signed-off-by: yihuaf <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1975 +/- ##
==========================================
+ Coverage 65.02% 65.28% +0.26%
==========================================
Files 129 129
Lines 14731 14784 +53
==========================================
+ Hits 9579 9652 +73
+ Misses 5152 5132 -20 |
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.
Could you write how to test?
In one terminal, run Currently, we are exposing this feature using a flag Give it a try first to see how you like how this prototype works currently. Note, |
#[clap(flatten)] | ||
youki_extend: YoukiExtendOpts, |
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 love this idea ❤️
@utam0k mentioned a usecase where when test
youki
inside k8s, it is hard to track logs of eachyouki
implementation. A workaround was usingbpf
tracing the syscalls. However, it would be much better to see the actualyouki
logs. This is wherejournald
comes in. It is one of the common ways for linux services and application to collect logs into a central place. In this PR, we implemented a different tracing layer that sendsyouki
logs tojournald
. All logs are tagged asyouki
and we can obtain the logs withjournalctl -t youki
.Note. I am not sure how best to enable this feature. I decided to implement this as a flag
--systemd-log
on the command line. However, this is not part of the OCI spec, so I added as a youki extension in the struct. However, this may not be the best way.Another way to implement this is through
features
.Tag along in this PR is a small refactor of the existing logging code. This refactors the logging into using different layers where we can get ready for the opentelelmetry work.