fix(monitoring): hostname, tooltip timestamps, default range (v0.5.1)

- Bug 1: Read hostname from /host/etc/hostname instead of os.Hostname()
  which returns the container ID inside Docker. Added volume mount.
- Bug 2: Tooltip callback used parsed.x (category index) instead of
  label (actual timestamp), showing 1970 dates.
- Bug 3+4: Default range changed from 24h to 1h so charts show data
  immediately on new deployments with limited history.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 11:01:08 +01:00
parent b43ccf698a
commit b19682a767
3 changed files with 15 additions and 9 deletions
+6 -2
View File
@@ -16,8 +16,12 @@ import (
func GetStaticInfo() StaticSystemInfo {
info := StaticSystemInfo{}
// Hostname
info.Hostname, _ = os.Hostname()
// Hostname — try host mount first, fall back to os.Hostname()
if data, err := os.ReadFile("/host/etc/hostname"); err == nil {
info.Hostname = strings.TrimSpace(string(data))
} else {
info.Hostname, _ = os.Hostname()
}
// OS — try host mount first, fall back to container's
info.OS = readOSRelease("/host/etc/os-release")