@cryptotaxi247 / netdata-1 / commits / 35ffc0c82

remove system info logging (#16517)

* log system info to debug * function cancel to debug * never log system info * setenv

Ilya Mashchenko committed Nov 30, 2023 at 22:14 UTC 35ffc0c82b4c74fa3f073cfda2df9eedfc8dbd31
3 files changed +6 -10
collectors/plugins.d/pluginsd_parser.c
+1 -1
@@ -1117,7 +1117,7 @@ void pluginsd_function_cancel(void *data) {
1117 dfe_done(t);
1118
1119 if(sent <= 0)
1120 - nd_log(NDLS_DAEMON, NDLP_NOTICE,
1120 + nd_log(NDLS_DAEMON, NDLP_DEBUG,
1121 "PLUGINSD: FUNCTION_CANCEL request didn't match any pending function requests in pluginsd.d.");
1122 }
1123
daemon/buildinfo.c
+2 -2
@@ -1291,7 +1291,7 @@ __attribute__((constructor)) void initialize_build_info(void) {
1291 // ----------------------------------------------------------------------------
1292 // system info
1293
1294 -int get_system_info(struct rrdhost_system_info *system_info, bool log);
1294 +int get_system_info(struct rrdhost_system_info *system_info);
1295 static void populate_system_info(void) {
1296 static bool populated = false;
1297 static SPINLOCK spinlock = NETDATA_SPINLOCK_INITIALIZER;
@@ -1314,7 +1314,7 @@ static void populate_system_info(void) {
1314 }
1315 else {
1316 system_info = callocz(1, sizeof(struct rrdhost_system_info));
1317 - get_system_info(system_info, false);
1317 + get_system_info(system_info);
1318 free_system_info = true;
1319 }
1320
daemon/main.c
+3 -7
@@ -1314,7 +1314,7 @@ static inline void coverity_remove_taint(char *s)
1314 (void)s;
1315 }
1316
1317 -int get_system_info(struct rrdhost_system_info *system_info, bool log) {
1317 +int get_system_info(struct rrdhost_system_info *system_info) {
1318 char *script;
1319 script = mallocz(sizeof(char) * (strlen(netdata_configured_primary_plugins_dir) + strlen("system-info.sh") + 2));
1320 sprintf(script, "%s/%s", netdata_configured_primary_plugins_dir, "system-info.sh");
@@ -1346,11 +1346,7 @@ int get_system_info(struct rrdhost_system_info *system_info, bool log) {
1346
1347 if(unlikely(rrdhost_set_system_info_variable(system_info, line, value))) {
1348 netdata_log_error("Unexpected environment variable %s=%s", line, value);
1349 - }
1350 - else {
1351 - if(log)
1352 - netdata_log_info("%s=%s", line, value);
1353 -
1349 + } else {
1350 setenv(line, value, 1);
1351 }
1352 }
@@ -2107,7 +2103,7 @@ int main(int argc, char **argv) {
2103 netdata_anonymous_statistics_enabled=-1;
2104 struct rrdhost_system_info *system_info = callocz(1, sizeof(struct rrdhost_system_info));
2105 __atomic_sub_fetch(&netdata_buffers_statistics.rrdhost_allocations_size, sizeof(struct rrdhost_system_info), __ATOMIC_RELAXED);
2110 - get_system_info(system_info, true);
2106 + get_system_info(system_info);
2107 (void) registry_get_this_machine_guid();
2108 system_info->hops = 0;
2109 get_install_type(&system_info->install_type, &system_info->prebuilt_arch, &system_info->prebuilt_dist);