diff options
Diffstat (limited to 'internal/cgroups/v1_linux.go')
-rw-r--r-- | internal/cgroups/v1_linux.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/cgroups/v1_linux.go b/internal/cgroups/v1_linux.go index 201d098fe..3c6ec1055 100644 --- a/internal/cgroups/v1_linux.go +++ b/internal/cgroups/v1_linux.go @@ -142,6 +142,10 @@ func (cg *CGroupV1Manager) addToCgroup(pid int, cgroupPath string) error { // Collect collects metrics from the cgroups controller func (cg *CGroupV1Manager) Collect(ch chan<- prometheus.Metric) { + if !cg.cfg.MetricsEnabled { + return + } + for i := 0; i < int(cg.cfg.Repositories.Count); i++ { repoPath := cg.repoPath(i) logger := log.Default().WithField("cgroup_path", repoPath) |