Merge pull request #2596 from katarzyna-z/kk-logs-resctrl
Verbosity level for resctrl and perf logs
This commit is contained in:
commit
922aa83feb
@ -18,7 +18,6 @@ package manager
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups/fs2"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
@ -48,6 +47,7 @@ import (
|
||||
"github.com/google/cadvisor/watcher"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups"
|
||||
"github.com/opencontainers/runc/libcontainer/cgroups/fs2"
|
||||
"github.com/opencontainers/runc/libcontainer/intelrdt"
|
||||
|
||||
"k8s.io/klog/v2"
|
||||
@ -932,7 +932,7 @@ func (m *manager) createContainerLocked(containerName string, watchSource watche
|
||||
perfCgroupPath := path.Join(fs2.UnifiedMountpoint, containerName)
|
||||
cont.perfCollector, err = m.perfManager.GetCollector(perfCgroupPath)
|
||||
if err != nil {
|
||||
klog.Infof("perf_event metrics will not be available for container %s: %s", containerName, err)
|
||||
klog.V(4).Infof("perf_event metrics will not be available for container %s: %s", containerName, err)
|
||||
}
|
||||
} else {
|
||||
devicesCgroupPath, err := handler.GetCgroupPath("devices")
|
||||
@ -950,18 +950,18 @@ func (m *manager) createContainerLocked(containerName string, watchSource watche
|
||||
} else {
|
||||
cont.perfCollector, err = m.perfManager.GetCollector(perfCgroupPath)
|
||||
if err != nil {
|
||||
klog.Infof("perf_event metrics will not be available for container %s: %s", containerName, err)
|
||||
klog.V(4).Infof("perf_event metrics will not be available for container %s: %s", containerName, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resctrlPath, err := intelrdt.GetIntelRdtPath(containerName)
|
||||
if err != nil {
|
||||
klog.Warningf("Error getting resctrl path: %q", err)
|
||||
klog.V(4).Infof("Error getting resctrl path: %q", err)
|
||||
} else {
|
||||
cont.resctrlCollector, err = m.resctrlManager.GetCollector(resctrlPath)
|
||||
if err != nil {
|
||||
klog.Infof("resctrl metrics will not be available for container %s: %s", cont.info.Name, err)
|
||||
klog.V(4).Infof("resctrl metrics will not be available for container %s: %s", cont.info.Name, err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,8 @@
|
||||
package resctrl
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/google/cadvisor/stats"
|
||||
|
||||
"github.com/opencontainers/runc/libcontainer/intelrdt"
|
||||
@ -29,6 +31,9 @@ type manager struct {
|
||||
}
|
||||
|
||||
func (m manager) GetCollector(resctrlPath string) (stats.Collector, error) {
|
||||
if _, err := os.Stat(resctrlPath); err != nil {
|
||||
return &stats.NoopCollector{}, err
|
||||
}
|
||||
collector := newCollector(m.id, resctrlPath)
|
||||
return collector, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user