summaryrefslogtreecommitdiffstats
path: root/collectors/apps.plugin
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-03-09 13:19:22 +0000
commitc21c3b0befeb46a51b6bf3758ffa30813bea0ff0 (patch)
tree9754ff1ca740f6346cf8483ec915d4054bc5da2d /collectors/apps.plugin
parentAdding upstream version 1.43.2. (diff)
downloadnetdata-upstream/1.44.3.tar.xz
netdata-upstream/1.44.3.zip
Adding upstream version 1.44.3.upstream/1.44.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--collectors/apps.plugin/apps_groups.conf2
-rw-r--r--collectors/apps.plugin/apps_plugin.c86
-rw-r--r--collectors/apps.plugin/integrations/applications.md33
-rw-r--r--collectors/apps.plugin/integrations/user_groups.md1
-rw-r--r--collectors/apps.plugin/integrations/users.md1
-rw-r--r--collectors/apps.plugin/metadata.yaml32
6 files changed, 80 insertions, 75 deletions
diff --git a/collectors/apps.plugin/apps_groups.conf b/collectors/apps.plugin/apps_groups.conf
index 9e9d83436..195536a0a 100644
--- a/collectors/apps.plugin/apps_groups.conf
+++ b/collectors/apps.plugin/apps_groups.conf
@@ -91,6 +91,7 @@ go.d.plugin: *go.d.plugin*
slabinfo.plugin: *slabinfo.plugin*
ebpf.plugin: *ebpf.plugin*
debugfs.plugin: *debugfs.plugin*
+logs-management.plugin: *logs-management.plugin*
# agent-service-discovery
agent_sd: agent_sd
@@ -381,6 +382,7 @@ rabbitmq: *rabbitmq*
sidekiq: *sidekiq*
java: java
ipfs: ipfs
+erlang: beam.smp
node: node
factorio: factorio
diff --git a/collectors/apps.plugin/apps_plugin.c b/collectors/apps.plugin/apps_plugin.c
index 152038968..5bcda84f4 100644
--- a/collectors/apps.plugin/apps_plugin.c
+++ b/collectors/apps.plugin/apps_plugin.c
@@ -3750,7 +3750,7 @@ static void send_collected_data_to_netdata(struct target *root, const char *type
struct target *w;
for (w = root; w ; w = w->next) {
- if (unlikely(!w->exposed && !w->is_other))
+ if (unlikely(!w->exposed))
continue;
send_BEGIN(type, w->clean_name, "processes", dt);
@@ -3806,16 +3806,30 @@ static void send_collected_data_to_netdata(struct target *root, const char *type
#endif
#ifndef __FreeBSD__
- send_BEGIN(type, w->clean_name, "uptime", dt);
- send_SET("uptime", (global_uptime > w->starttime) ? (global_uptime - w->starttime) : 0);
- send_END();
+ if (w->processes == 0) {
+ send_BEGIN(type, w->clean_name, "uptime", dt);
+ send_SET("uptime", 0);
+ send_END();
- if (enable_detailed_uptime_charts) {
- send_BEGIN(type, w->clean_name, "uptime_summary", dt);
- send_SET("min", w->uptime_min);
- send_SET("avg", w->processes > 0 ? w->uptime_sum / w->processes : 0);
- send_SET("max", w->uptime_max);
+ if (enable_detailed_uptime_charts) {
+ send_BEGIN(type, w->clean_name, "uptime_summary", dt);
+ send_SET("min", 0);
+ send_SET("avg", 0);
+ send_SET("max", 0);
+ send_END();
+ }
+ } else {
+ send_BEGIN(type, w->clean_name, "uptime", dt);
+ send_SET("uptime", (global_uptime > w->starttime) ? (global_uptime - w->starttime) : 0);
send_END();
+
+ if (enable_detailed_uptime_charts) {
+ send_BEGIN(type, w->clean_name, "uptime_summary", dt);
+ send_SET("min", w->uptime_min);
+ send_SET("avg", w->processes > 0 ? w->uptime_sum / w->processes : 0);
+ send_SET("max", w->uptime_max);
+ send_END();
+ }
}
#endif
@@ -3860,7 +3874,7 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type
if (debug_enabled) {
for (w = root; w; w = w->next) {
- if (unlikely(w->debug_enabled && !w->target && w->processes)) {
+ if (unlikely(!w->target && w->processes)) {
struct pid_on_target *pid_on_target;
fprintf(stderr, "apps.plugin: target '%s' has aggregated %u process(es):", w->name, w->processes);
for (pid_on_target = w->root_pid; pid_on_target; pid_on_target = pid_on_target->next) {
@@ -3878,7 +3892,7 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type
w->exposed = 1;
fprintf(stdout, "CHART %s.%s_cpu_utilization '' '%s CPU utilization (100%% = 1 core)' 'percentage' cpu %s.cpu_utilization stacked 20001 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION user '' absolute 1 %llu\n", time_factor * RATES_DETAIL / 100LLU);
fprintf(stdout, "DIMENSION system '' absolute 1 %llu\n", time_factor * RATES_DETAIL / 100LLU);
@@ -3886,84 +3900,84 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type
#ifndef __FreeBSD__
if (enable_guest_charts) {
fprintf(stdout, "CHART %s.%s_cpu_guest_utilization '' '%s CPU guest utlization (100%% = 1 core)' 'percentage' cpu %s.cpu_guest_utilization line 20005 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION guest '' absolute 1 %llu\n", time_factor * RATES_DETAIL / 100LLU);
}
fprintf(stdout, "CHART %s.%s_cpu_context_switches '' '%s CPU context switches' 'switches/s' cpu %s.cpu_context_switches stacked 20010 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION voluntary '' absolute 1 %llu\n", RATES_DETAIL);
fprintf(stdout, "DIMENSION involuntary '' absolute 1 %llu\n", RATES_DETAIL);
fprintf(stdout, "CHART %s.%s_mem_private_usage '' '%s memory usage without shared' 'MiB' mem %s.mem_private_usage area 20050 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION mem '' absolute %ld %ld\n", 1L, 1024L);
#endif
fprintf(stdout, "CHART %s.%s_mem_usage '' '%s memory RSS usage' 'MiB' mem %s.mem_usage area 20055 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION rss '' absolute %ld %ld\n", 1L, 1024L);
fprintf(stdout, "CHART %s.%s_mem_page_faults '' '%s memory page faults' 'pgfaults/s' mem %s.mem_page_faults stacked 20060 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION major '' absolute 1 %llu\n", RATES_DETAIL);
fprintf(stdout, "DIMENSION minor '' absolute 1 %llu\n", RATES_DETAIL);
fprintf(stdout, "CHART %s.%s_vmem_usage '' '%s virtual memory size' 'MiB' mem %s.vmem_usage line 20065 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION vmem '' absolute %ld %ld\n", 1L, 1024L);
#ifndef __FreeBSD__
fprintf(stdout, "CHART %s.%s_swap_usage '' '%s swap usage' 'MiB' mem %s.swap_usage area 20065 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION swap '' absolute %ld %ld\n", 1L, 1024L);
#endif
#ifndef __FreeBSD__
fprintf(stdout, "CHART %s.%s_disk_physical_io '' '%s disk physical IO' 'KiB/s' disk %s.disk_physical_io area 20100 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION reads '' absolute 1 %llu\n", 1024LLU * RATES_DETAIL);
fprintf(stdout, "DIMENSION writes '' absolute -1 %llu\n", 1024LLU * RATES_DETAIL);
fprintf(stdout, "CHART %s.%s_disk_logical_io '' '%s disk logical IO' 'KiB/s' disk %s.disk_logical_io area 20105 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION reads '' absolute 1 %llu\n", 1024LLU * RATES_DETAIL);
fprintf(stdout, "DIMENSION writes '' absolute -1 %llu\n", 1024LLU * RATES_DETAIL);
#else
fprintf(stdout, "CHART %s.%s_disk_physical_io '' '%s disk physical IO' 'blocks/s' disk %s.disk_physical_block_io area 20100 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION reads '' absolute 1 %llu\n", RATES_DETAIL);
fprintf(stdout, "DIMENSION writes '' absolute -1 %llu\n", RATES_DETAIL);
#endif
fprintf(stdout, "CHART %s.%s_processes '' '%s processes' 'processes' processes %s.processes line 20150 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION processes '' absolute 1 1\n");
fprintf(stdout, "CHART %s.%s_threads '' '%s threads' 'threads' processes %s.threads line 20155 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION threads '' absolute 1 1\n");
if (enable_file_charts) {
fprintf(stdout, "CHART %s.%s_fds_open_limit '' '%s open file descriptors limit' '%%' fds %s.fds_open_limit line 20200 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION limit '' absolute 1 100\n");
fprintf(stdout, "CHART %s.%s_fds_open '' '%s open files descriptors' 'fds' fds %s.fds_open stacked 20210 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION files '' absolute 1 1\n");
fprintf(stdout, "DIMENSION sockets '' absolute 1 1\n");
@@ -3978,13 +3992,13 @@ static void send_charts_updates_to_netdata(struct target *root, const char *type
#ifndef __FreeBSD__
fprintf(stdout, "CHART %s.%s_uptime '' '%s uptime' 'seconds' uptime %s.uptime line 20250 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION uptime '' absolute 1 1\n");
if (enable_detailed_uptime_charts) {
fprintf(stdout, "CHART %s.%s_uptime_summary '' '%s uptime summary' 'seconds' uptime %s.uptime_summary area 20255 %d\n", type, w->clean_name, title, type, update_every);
- fprintf(stdout, "CLABEL '%s' '%s' 0\n", lbl_name, w->name);
+ fprintf(stdout, "CLABEL '%s' '%s' 1\n", lbl_name, w->name);
fprintf(stdout, "CLABEL_COMMIT\n");
fprintf(stdout, "DIMENSION min '' absolute 1 1\n");
fprintf(stdout, "DIMENSION avg '' absolute 1 1\n");
@@ -5234,25 +5248,11 @@ static void function_processes(const char *transaction, char *function __maybe_u
static bool apps_plugin_exit = false;
int main(int argc, char **argv) {
- // debug_flags = D_PROCFILE;
- stderror = stderr;
-
clocks_init();
+ nd_log_initialize_for_external_plugins("apps.plugin");
pagesize = (size_t)sysconf(_SC_PAGESIZE);
- // set the name for logging
- program_name = "apps.plugin";
-
- // disable syslog for apps.plugin
- error_log_syslog = 0;
-
- // set errors flood protection to 100 logs per hour
- error_log_errors_per_period = 100;
- error_log_throttle_period = 3600;
-
- log_set_global_severity_for_external_plugins();
-
bool send_resource_usage = true;
{
const char *s = getenv("NETDATA_INTERNALS_MONITORING");
@@ -5264,7 +5264,7 @@ int main(int argc, char **argv) {
procfile_open_flags = O_RDONLY|O_NOFOLLOW;
netdata_configured_host_prefix = getenv("NETDATA_HOST_PREFIX");
- if(verify_netdata_host_prefix() == -1) exit(1);
+ if(verify_netdata_host_prefix(true) == -1) exit(1);
user_config_dir = getenv("NETDATA_USER_CONFIG_DIR");
if(user_config_dir == NULL) {
diff --git a/collectors/apps.plugin/integrations/applications.md b/collectors/apps.plugin/integrations/applications.md
index f4bbc8733..e5219fcc2 100644
--- a/collectors/apps.plugin/integrations/applications.md
+++ b/collectors/apps.plugin/integrations/applications.md
@@ -4,6 +4,7 @@ meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/apps.plugi
sidebar_label: "Applications"
learn_status: "Published"
learn_rel_path: "Data Collection/Processes and System Services"
+most_popular: False
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
endmeta-->
@@ -66,22 +67,22 @@ Metrics:
| Metric | Dimensions | Unit |
|:------|:----------|:----|
-| app_group.cpu_utilization | user, system | percentage |
-| app_group.cpu_guest_utilization | guest | percentage |
-| app_group.cpu_context_switches | voluntary, involuntary | switches/s |
-| app_group.mem_usage | rss | MiB |
-| app_group.mem_private_usage | mem | MiB |
-| app_group.vmem_usage | vmem | MiB |
-| app_group.mem_page_faults | minor, major | pgfaults/s |
-| app_group.swap_usage | swap | MiB |
-| app_group.disk_physical_io | reads, writes | KiB/s |
-| app_group.disk_logical_io | reads, writes | KiB/s |
-| app_group.processes | processes | processes |
-| app_group.threads | threads | threads |
-| app_group.fds_open_limit | limit | percentage |
-| app_group.fds_open | files, sockets, pipes, inotifies, event, timer, signal, eventpolls, other | fds |
-| app_group.uptime | uptime | seconds |
-| app_group.uptime_summary | min, avg, max | seconds |
+| app.cpu_utilization | user, system | percentage |
+| app.cpu_guest_utilization | guest | percentage |
+| app.cpu_context_switches | voluntary, involuntary | switches/s |
+| app.mem_usage | rss | MiB |
+| app.mem_private_usage | mem | MiB |
+| app.vmem_usage | vmem | MiB |
+| app.mem_page_faults | minor, major | pgfaults/s |
+| app.swap_usage | swap | MiB |
+| app.disk_physical_io | reads, writes | KiB/s |
+| app.disk_logical_io | reads, writes | KiB/s |
+| app.processes | processes | processes |
+| app.threads | threads | threads |
+| app.fds_open_limit | limit | percentage |
+| app.fds_open | files, sockets, pipes, inotifies, event, timer, signal, eventpolls, other | fds |
+| app.uptime | uptime | seconds |
+| app.uptime_summary | min, avg, max | seconds |
diff --git a/collectors/apps.plugin/integrations/user_groups.md b/collectors/apps.plugin/integrations/user_groups.md
index 6f56d7be6..4ccbfc95f 100644
--- a/collectors/apps.plugin/integrations/user_groups.md
+++ b/collectors/apps.plugin/integrations/user_groups.md
@@ -4,6 +4,7 @@ meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/apps.plugi
sidebar_label: "User Groups"
learn_status: "Published"
learn_rel_path: "Data Collection/Processes and System Services"
+most_popular: False
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
endmeta-->
diff --git a/collectors/apps.plugin/integrations/users.md b/collectors/apps.plugin/integrations/users.md
index f325f05f6..c151fd8a2 100644
--- a/collectors/apps.plugin/integrations/users.md
+++ b/collectors/apps.plugin/integrations/users.md
@@ -4,6 +4,7 @@ meta_yaml: "https://github.com/netdata/netdata/edit/master/collectors/apps.plugi
sidebar_label: "Users"
learn_status: "Published"
learn_rel_path: "Data Collection/Processes and System Services"
+most_popular: False
message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE COLLECTOR'S metadata.yaml FILE"
endmeta-->
diff --git a/collectors/apps.plugin/metadata.yaml b/collectors/apps.plugin/metadata.yaml
index f24160ba7..f5f22853a 100644
--- a/collectors/apps.plugin/metadata.yaml
+++ b/collectors/apps.plugin/metadata.yaml
@@ -73,90 +73,90 @@ modules:
- name: app_group
description: The name of the group defined in the configuration.
metrics:
- - name: app_group.cpu_utilization
+ - name: app.cpu_utilization
description: Apps CPU utilization (100% = 1 core)
unit: percentage
chart_type: stacked
dimensions:
- name: user
- name: system
- - name: app_group.cpu_guest_utilization
+ - name: app.cpu_guest_utilization
description: Apps CPU guest utilization (100% = 1 core)
unit: percentage
chart_type: line
dimensions:
- name: guest
- - name: app_group.cpu_context_switches
+ - name: app.cpu_context_switches
description: Apps CPU context switches
unit: switches/s
chart_type: stacked
dimensions:
- name: voluntary
- name: involuntary
- - name: app_group.mem_usage
+ - name: app.mem_usage
description: Apps memory RSS usage
unit: MiB
chart_type: line
dimensions:
- name: rss
- - name: app_group.mem_private_usage
+ - name: app.mem_private_usage
description: Apps memory usage without shared
unit: MiB
chart_type: stacked
dimensions:
- name: mem
- - name: app_group.vmem_usage
+ - name: app.vmem_usage
description: Apps virtual memory size
unit: MiB
chart_type: line
dimensions:
- name: vmem
- - name: app_group.mem_page_faults
+ - name: app.mem_page_faults
description: Apps memory page faults
unit: pgfaults/s
chart_type: stacked
dimensions:
- name: minor
- name: major
- - name: app_group.swap_usage
+ - name: app.swap_usage
description: Apps swap usage
unit: MiB
chart_type: area
dimensions:
- name: swap
- - name: app_group.disk_physical_io
+ - name: app.disk_physical_io
description: Apps disk physical IO
unit: KiB/s
chart_type: area
dimensions:
- name: reads
- name: writes
- - name: app_group.disk_logical_io
+ - name: app.disk_logical_io
description: Apps disk logical IO
unit: KiB/s
chart_type: area
dimensions:
- name: reads
- name: writes
- - name: app_group.processes
+ - name: app.processes
description: Apps processes
unit: processes
chart_type: line
dimensions:
- name: processes
- - name: app_group.threads
+ - name: app.threads
description: Apps threads
unit: threads
chart_type: line
dimensions:
- name: threads
- - name: app_group.fds_open_limit
+ - name: app.fds_open_limit
description: Apps open file descriptors limit
unit: percentage
chart_type: line
dimensions:
- name: limit
- - name: app_group.fds_open
+ - name: app.fds_open
description: Apps open file descriptors
unit: fds
chart_type: stacked
@@ -170,13 +170,13 @@ modules:
- name: signal
- name: eventpolls
- name: other
- - name: app_group.uptime
+ - name: app.uptime
description: Apps uptime
unit: seconds
chart_type: line
dimensions:
- name: uptime
- - name: app_group.uptime_summary
+ - name: app.uptime_summary
description: Apps uptime summary
unit: seconds
chart_type: area