fix(insights): check if running in a container

Signed-off-by: Deluan <deluan@navidrome.org>
This commit is contained in:
Deluan 2024-12-19 17:54:19 -05:00
parent 6bc4c0317f
commit 906ac635c2
4 changed files with 17 additions and 5 deletions

View file

@ -151,6 +151,7 @@ var staticData = sync.OnceValue(func() insights.Data {
// Build info
data.Build.Settings, data.Build.GoVersion = buildInfo()
data.OS.Containerized = consts.InContainer
// OS info
data.OS.Type = runtime.GOOS

View file

@ -10,11 +10,12 @@ type Data struct {
GoVersion string `json:"goVersion"`
} `json:"build"`
OS struct {
Type string `json:"type"`
Distro string `json:"distro,omitempty"`
Version string `json:"version,omitempty"`
Arch string `json:"arch"`
NumCPU int `json:"numCPU"`
Type string `json:"type"`
Distro string `json:"distro,omitempty"`
Version string `json:"version,omitempty"`
Containerized bool `json:"containerized"`
Arch string `json:"arch"`
NumCPU int `json:"numCPU"`
} `json:"os"`
Mem struct {
Alloc uint64 `json:"alloc"`