mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 23:04:20 +01:00
Merge pull request #5450 from openanolis/trace_rs
feat(Tracing): tracing in Rust runtime
This commit is contained in:
@@ -31,6 +31,7 @@ serde_json = "1.0.82"
|
||||
slog = "2.5.2"
|
||||
slog-scope = "4.4.0"
|
||||
tokio = { version = "1.28.1", features = ["process"] }
|
||||
tracing = "0.1.36"
|
||||
uuid = { version = "0.4", features = ["v4"] }
|
||||
|
||||
agent = { path = "../agent" }
|
||||
|
||||
@@ -17,6 +17,7 @@ use kata_types::mount::Mount;
|
||||
use oci::{Linux, LinuxResources};
|
||||
use persist::sandbox_persist::Persist;
|
||||
use tokio::sync::RwLock;
|
||||
use tracing::instrument;
|
||||
|
||||
use crate::network::NetworkConfig;
|
||||
use crate::resource_persist::ResourceState;
|
||||
@@ -34,6 +35,12 @@ pub struct ResourceManager {
|
||||
inner: Arc<RwLock<ResourceManagerInner>>,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for ResourceManager {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("ResourceManager").finish()
|
||||
}
|
||||
}
|
||||
|
||||
impl ResourceManager {
|
||||
pub async fn new(
|
||||
sid: &str,
|
||||
@@ -58,6 +65,7 @@ impl ResourceManager {
|
||||
inner.get_device_manager()
|
||||
}
|
||||
|
||||
#[instrument]
|
||||
pub async fn prepare_before_start_vm(&self, device_configs: Vec<ResourceConfig>) -> Result<()> {
|
||||
let mut inner = self.inner.write().await;
|
||||
inner.prepare_before_start_vm(device_configs).await
|
||||
@@ -68,6 +76,7 @@ impl ResourceManager {
|
||||
inner.handle_network(network_config).await
|
||||
}
|
||||
|
||||
#[instrument]
|
||||
pub async fn setup_after_start_vm(&self) -> Result<()> {
|
||||
let mut inner = self.inner.write().await;
|
||||
inner.setup_after_start_vm().await
|
||||
|
||||
Reference in New Issue
Block a user