Initial fluentd support (#205)

* fix(hack): use sudo -E when running Rust binaries

This makes it possible to pass envvars to the Krata runtime

* feat(o11y): add fluent sink to logs

This change adds fluent logging as an opt-in feature. Setting
`KRATA_LOG_FLUENT` with an address:port will start a TCP connection,
sending logs.

A later changes will respect a URI scheme and use structured logging.
This commit is contained in:
Khionu Sybiern authored and GitHub committed 2024-06-25 19:10:57 +00:00
1 parent 93aae83b3f
commit 88a62441b1
3 files changed
+35 -8

No files matched your search

+2 -1
View File
@@ -9,7 +9,7 @@ use krata::{
idm::{internal::event::Event as EventType, internal::Event},
v1::common::{GuestExitInfo, GuestState, GuestStatus},
};
use log::{error, warn};
use log::{error, info, warn};
use tokio::{
select,
sync::{
@@ -90,6 +90,7 @@ impl DaemonEventGenerator {
let status = state.status();
let id = Uuid::from_str(&guest.id)?;
let domid = state.domid;
info!("Guest {} on Zone {} changed - {:?}", id, domid, status);
match status {
GuestStatus::Started => {
if let Entry::Vacant(e) = self.idms.entry(domid) {