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
2024-06-25 12:10:57 -07:00
committed by GitHub
parent 93aae83b3f
commit 88a62441b1
3 changed files with 35 additions and 8 deletions

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) {