summaryrefslogtreecommitdiffstats
path: root/daemon/analytics.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-10-17 09:30:23 +0000
commit517a443636daa1e8085cb4e5325524a54e8a8fd7 (patch)
tree5352109cc7cd5122274ab0cfc1f887b685f04edf /daemon/analytics.c
parentReleasing debian version 1.42.4-1. (diff)
downloadnetdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.tar.xz
netdata-517a443636daa1e8085cb4e5325524a54e8a8fd7.zip
Merging upstream version 1.43.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemon/analytics.c')
-rw-r--r--daemon/analytics.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/daemon/analytics.c b/daemon/analytics.c
index 9323c8e8a..c149e2583 100644
--- a/daemon/analytics.c
+++ b/daemon/analytics.c
@@ -109,6 +109,7 @@ void analytics_free_data(void)
freez(analytics_data.netdata_config_use_private_registry);
freez(analytics_data.netdata_config_oom_score);
freez(analytics_data.netdata_prebuilt_distro);
+ freez(analytics_data.netdata_fail_reason);
}
/*
@@ -127,7 +128,7 @@ void analytics_set_data(char **name, char *value)
/*
* Set a string data with a value
*/
-void analytics_set_data_str(char **name, char *value)
+void analytics_set_data_str(char **name, const char *value)
{
size_t value_string_len;
if (*name) {
@@ -899,6 +900,7 @@ void set_global_environment()
analytics_set_data(&analytics_data.netdata_config_use_private_registry, "null");
analytics_set_data(&analytics_data.netdata_config_oom_score, "null");
analytics_set_data(&analytics_data.netdata_prebuilt_distro, "null");
+ analytics_set_data(&analytics_data.netdata_fail_reason, "null");
analytics_data.prometheus_hits = 0;
analytics_data.shell_hits = 0;
@@ -974,6 +976,7 @@ void send_statistics(const char *action, const char *action_result, const char *
action_result = "";
if (!action_data)
action_data = "";
+
char *command_to_run = mallocz(
sizeof(char) * (strlen(action) + strlen(action_result) + strlen(action_data) + strlen(as_script) +
analytics_data.data_length + (ANALYTICS_NO_OF_ITEMS * 3) + 15));
@@ -981,7 +984,7 @@ void send_statistics(const char *action, const char *action_result, const char *
sprintf(
command_to_run,
- "%s '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' ",
+ "%s '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' '%s' ",
as_script,
action,
action_result,
@@ -1024,7 +1027,8 @@ void send_statistics(const char *action, const char *action_result, const char *
analytics_data.netdata_config_is_private_registry,
analytics_data.netdata_config_use_private_registry,
analytics_data.netdata_config_oom_score,
- analytics_data.netdata_prebuilt_distro);
+ analytics_data.netdata_prebuilt_distro,
+ analytics_data.netdata_fail_reason);
netdata_log_info("%s '%s' '%s' '%s'", as_script, action, action_result, action_data);