@cryptotaxi247 / netdata-1 / commits / df8bf668b

fix excessive "maximum number of cgroups reached" log messages (#16730)

Ilya Mashchenko committed Jan 5, 2024 at 14:49 UTC df8bf668b699f2d7dd696e46bc29f5f55aed8b48
1 file changed +4 -2
collectors/cgroups.plugin/cgroup-discovery.c
+4 -2
@@ -351,6 +351,7 @@ static inline void discovery_find_cgroup_in_dir_callback(const char *dir) {
351 if (!dir || !*dir) {
352 dir = "/";
353 }
354 +
355 netdata_log_debug(D_CGROUP, "examining cgroup dir '%s'", dir);
356
357 struct cgroup *cg = discovery_cgroup_find(dir);
@@ -360,14 +361,15 @@ static inline void discovery_find_cgroup_in_dir_callback(const char *dir) {
361 }
362
363 if (cgroup_root_count >= cgroup_root_max) {
363 - collector_info("CGROUP: maximum number of cgroups reached (%d). Not adding cgroup '%s'", cgroup_root_count, dir);
364 + nd_log_limit_static_global_var(erl, 3600, 0);
365 + nd_log_limit(&erl, NDLS_COLLECTORS, NDLP_WARNING, "CGROUP: maximum number of cgroups reached (%d). No more cgroups will be added.", cgroup_root_count);
366 return;
367 }
368
369 if (cgroup_max_depth > 0) {
370 int depth = calc_cgroup_depth(dir);
371 if (depth > cgroup_max_depth) {
370 - collector_info("CGROUP: '%s' is too deep (%d, while max is %d)", dir, depth, cgroup_max_depth);
372 + nd_log_collector(NDLP_DEBUG, "CGROUP: '%s' is too deep (%d, while max is %d)", dir, depth, cgroup_max_depth);
373 return;
374 }
375 }