tracing: Add tracing to runtime-rs

Introduce tracing into runtime-rs, only some functions are instrumented.

Fixes: #5239

Signed-off-by: Ji-Xinyou <jerryji0414@outlook.com>
Signed-off-by: Yushuo <y-shuo@linux.alibaba.com>
This commit is contained in:
Ji-Xinyou
2022-09-23 17:56:58 +08:00
committed by Yushuo
parent 58e921eace
commit ed23b47c71
22 changed files with 942 additions and 464 deletions

View File

@@ -29,12 +29,15 @@ slog-stdlog = "4.1.0"
thiserror = "1.0.30"
tokio = { version = "1.28.1", features = [ "rt", "rt-multi-thread" ] }
unix_socket2 = "0.5.4"
tracing = "0.1.36"
tracing-opentelemetry = "0.18.0"
kata-types = { path = "../../../libs/kata-types"}
kata-sys-util = { path = "../../../libs/kata-sys-util"}
logging = { path = "../../../libs/logging"}
oci = { path = "../../../libs/oci" }
service = { path = "../service" }
runtimes = { path = "../runtimes" }
[dev-dependencies]
tempfile = "3.2.0"

View File

@@ -142,7 +142,7 @@ fn real_main() -> Result<()> {
Action::Delete(args) => {
let mut shim = ShimExecutor::new(args);
let rt = get_tokio_runtime().context("get tokio runtime")?;
rt.block_on(shim.delete())?
rt.block_on(shim.delete())?;
}
Action::Run(args) => {
// set mnt namespace
@@ -151,7 +151,7 @@ fn real_main() -> Result<()> {
let mut shim = ShimExecutor::new(args);
let rt = get_tokio_runtime().context("get tokio runtime")?;
rt.block_on(shim.run())?
rt.block_on(shim.run())?;
}
Action::Help => show_help(&args[0]),
Action::Version => show_version(None),

View File

@@ -20,6 +20,7 @@ const SHIM_PID_FILE: &str = "shim.pid";
pub(crate) const ENV_KATA_RUNTIME_BIND_FD: &str = "KATA_RUNTIME_BIND_FD";
/// Command executor for shim.
#[derive(Debug)]
pub struct ShimExecutor {
pub(crate) args: Args,
}