feat(telemetry): report process memory and process and host uptime

This commit is contained in:
lda committed 2026-10-12 16:28:21 +07:00 Verified
1 parent b98b8717d1
commit 4a4acedbc3
16 files changed
+311 -8

No files matched your search

+3
View File
@@ -37,3 +37,6 @@ url = "2"
vt100 = { package = "wakey-vt100", path = "../vendor/vt100", registry = "gitea", version = "=0.16.2-wakey.2" }
wakey = { path = "..", registry = "gitea", version = "0" }
wakey-core = { path = "../wakey-core", registry = "gitea", version = "0", features = ["telemetry"] }
[target.'cfg(target_os = "linux")'.dependencies]
wakey-linux = { path = "../wakey-linux", registry = "gitea", version = "0", features = ["telemetry"] }
+5 -2
View File
@@ -6,7 +6,7 @@ pub fn init(
config: &TelemetryConfig,
agent_id: Option<&str>,
) -> Result<TelemetryGuard> {
wakey_core::telemetry::init(
let guard = wakey_core::telemetry::init(
config,
"wakey-agent",
match verbose {
@@ -15,5 +15,8 @@ pub fn init(
_ => "wakey_agent=trace,wakey=debug,wakey_core=info,opentelemetry=warn",
},
agent_id,
)
)?;
#[cfg(target_os = "linux")]
let guard = guard.with_process_metrics(wakey_linux::telemetry::ProcfsProcessMetrics);
Ok(guard)
}