From ee92e338cbb1524cfe6c421dd15260536b164e00 Mon Sep 17 00:00:00 2001 From: Henry Dollman Date: Wed, 16 Oct 2024 18:12:43 -0400 Subject: [PATCH] update debug log locations --- beszel/internal/agent/agent.go | 3 +++ beszel/internal/agent/server.go | 1 - beszel/internal/agent/system.go | 6 ------ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/beszel/internal/agent/agent.go b/beszel/internal/agent/agent.go index a254b314..df35f4fd 100644 --- a/beszel/internal/agent/agent.go +++ b/beszel/internal/agent/agent.go @@ -83,9 +83,11 @@ func (a *Agent) gatherStats() system.CombinedData { Stats: a.getSystemStats(), Info: a.systemInfo, } + slog.Debug("System stats", "data", systemData) // add docker stats if containerStats, err := a.dockerManager.getDockerStats(); err == nil { systemData.Containers = containerStats + slog.Debug("Docker stats", "data", systemData.Containers) } else { slog.Debug("Error getting docker stats", "err", err) } @@ -96,5 +98,6 @@ func (a *Agent) gatherStats() system.CombinedData { systemData.Stats.ExtraFs[name] = stats } } + slog.Debug("Extra filesystems", "data", systemData.Stats.ExtraFs) return systemData } diff --git a/beszel/internal/agent/server.go b/beszel/internal/agent/server.go index fb773cd1..384d9ccd 100644 --- a/beszel/internal/agent/server.go +++ b/beszel/internal/agent/server.go @@ -25,7 +25,6 @@ func (a *Agent) startServer(pubKey []byte, addr string) { func (a *Agent) handleSession(s sshServer.Session) { stats := a.gatherStats() - slog.Debug("Sending stats", "data", stats) if err := json.NewEncoder(s).Encode(stats); err != nil { slog.Error("Error encoding stats", "err", err) s.Exit(1) diff --git a/beszel/internal/agent/system.go b/beszel/internal/agent/system.go index 4716dd21..898459cd 100644 --- a/beszel/internal/agent/system.go +++ b/beszel/internal/agent/system.go @@ -53,7 +53,6 @@ func (a *Agent) getSystemStats() system.Stats { systemStats := system.Stats{} // cpu percent - slog.Debug("Getting cpu percent") cpuPct, err := cpu.Percent(0, false) if err != nil { slog.Error("Error getting cpu percent", "err", err) @@ -62,7 +61,6 @@ func (a *Agent) getSystemStats() system.Stats { } // memory - slog.Debug("Getting memory stats") if v, err := mem.VirtualMemory(); err == nil { // swap systemStats.Swap = bytesToGigabytes(v.SwapTotal) @@ -91,7 +89,6 @@ func (a *Agent) getSystemStats() system.Stats { } // disk usage - slog.Debug("Getting disk stats") for _, stats := range a.fsStats { if d, err := disk.Usage(stats.Mountpoint); err == nil { stats.DiskTotal = bytesToGigabytes(d.Total) @@ -112,7 +109,6 @@ func (a *Agent) getSystemStats() system.Stats { } // disk i/o - slog.Debug("Getting disk I/O stats") if ioCounters, err := disk.IOCounters(a.fsNames...); err == nil { for _, d := range ioCounters { stats := a.fsStats[d.Name] @@ -136,7 +132,6 @@ func (a *Agent) getSystemStats() system.Stats { } // network stats - slog.Debug("Getting network stats") if netIO, err := psutilNet.IOCounters(true); err == nil { secondsElapsed := time.Since(a.netIoStats.Time).Seconds() a.netIoStats.Time = time.Now() @@ -177,7 +172,6 @@ func (a *Agent) getSystemStats() system.Stats { } // temperatures - slog.Debug("Getting temperatures") temps, err := sensors.TemperaturesWithContext(a.sensorsContext) if err != nil && a.debug { err.(*sensors.Warnings).Verbose = true