runwasi icon indicating copy to clipboard operation
runwasi copied to clipboard

Enable Binary logging support

Open jsturtevant opened this issue 1 year ago • 4 comments

Containerd has pluggable logging which includes binary logging: https://github.com/containerd/containerd/blob/c7f7fa5390f761b83c3a69cd5709a8d04d912969/core/runtime/v2/README.md#logging

Currently we support fifo/file/npipe

jsturtevant avatar Jun 24 '24 23:06 jsturtevant

What's the main benefits of supporting Binary logging?

Mossaka avatar Jun 25 '24 01:06 Mossaka

the main benefit of binary logging is that you can do highly structured snapshots and various other customized things to not only compress but treat the log as a kind of database. So, for example, systemd and mysql (in fact, almost every db or db service) uses binary logging. Size is not the main concern, but "structured responsiveness".

outside of that, you can just compress the text log if size is your only concern (though ongoing size is typically smaller with binary).

In this case, we have a Windows customer who needs this to make runwasi a "drop-in" replacement for the current shim.

squillace avatar Jun 25 '24 07:06 squillace

From https://github.com/containerd/containerd/issues/6639:

Example policies that a custom log plugin might enforce include: Log data is pre-processed to remove potentially sensitive information (e.g. via https://github.com/stripe/unilog) Pre-processed log data is not allowed to be written to persistent disk. Log lines may be persisted to remote storage at different sampling levels depending on content.

learned a little bit more about how binary loggers should work: they are expected to be called, and piping I/O in to the custom logger. An example the logger is in https://github.com/containerd/containerd/pull/3085

jsturtevant avatar Jun 26 '24 23:06 jsturtevant

Yeah sounds good. Perhaps this issue belongs to rust-extensions repo, though?

Mossaka avatar Jul 02 '24 15:07 Mossaka