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

@@ -11,6 +11,7 @@ async-trait = "0.1.48"
slog = "2.5.2"
slog-scope = "4.4.0"
tokio = { version = "1.28.1", features = ["rt-multi-thread"] }
tracing = "0.1.36"
ttrpc = { version = "0.7.1" }
common = { path = "../runtimes/common" }

View File

@@ -39,6 +39,19 @@ pub struct ServiceManager {
namespace: String,
}
impl std::fmt::Debug for ServiceManager {
// todo: some how to implement debug for handler
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("ServiceManager")
.field("receiver", &self.receiver)
.field("task_server.is_some()", &self.task_server.is_some())
.field("binary", &self.binary)
.field("address", &self.address)
.field("namespace", &self.namespace)
.finish()
}
}
async fn send_event(
containerd_binary: String,
address: String,