apps: always expose "other" group (#16198)
Ilya Mashchenko committed
Oct 14, 2023 at 18:54 UTC
594473cd003b50bf9787cb839b26320f857c0121
1 file changed
+6
-3
collectors/apps.plugin/apps_plugin.c
+6
-3
@@ -269,6 +269,8 @@ struct target {
269
uid_t uid;
270
gid_t gid;
271
272
+ bool is_other;
273
+
274
kernel_uint_t minflt;
275
kernel_uint_t cminflt;
276
kernel_uint_t majflt;
@@ -1007,6 +1009,7 @@ static int read_apps_groups_conf(const char *path, const char *file)
1009
apps_groups_default_target = get_apps_groups_target("p+!o@w#e$i^r&7*5(-i)l-o_", NULL, "other"); // match nothing
1010
if(!apps_groups_default_target)
1011
fatal("Cannot create default target");
1012
+ apps_groups_default_target->is_other = true;
1013
1014
// allow the user to override group 'other'
1015
if(apps_groups_default_target->target)
@@ -3747,7 +3750,7 @@ static void send_collected_data_to_netdata(struct target *root, const char *type
3750
struct target *w;
3751
3752
for (w = root; w ; w = w->next) {
3750
- if(unlikely(!w->exposed))
3753
+ if (unlikely(!w->exposed && !w->is_other))
3754
continue;
3755
3756
send_BEGIN(type, w->clean_name, "processes", dt);
@@ -3758,7 +3761,7 @@ static void send_collected_data_to_netdata(struct target *root, const char *type
3761
send_SET("threads", w->num_threads);
3762
send_END();
3763
3761
- if(unlikely(!w->processes))
3764
+ if (unlikely(!w->processes && !w->is_other))
3765
continue;
3766
3767
send_BEGIN(type, w->clean_name, "cpu_utilization", dt);
@@ -3869,7 +3872,7 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type
3872
}
3873
3874
for (w = root; w; w = w->next) {
3872
- if (likely(w->exposed || !w->processes))
3875
+ if (likely(w->exposed || (!w->processes && !w->is_other)))
3876
continue;
3877
3878
w->exposed = 1;