@cryptotaxi247 / netdata-1 / commits / 30ce1c249

Send anonymous statistics from backends and exporting engine (#9125)

Vladimir Kobal committed May 22, 2020 at 22:24 UTC 30ce1c2497f7c8db247c7a3d5b28928d8dd3d1e2
5 files changed +6
backends/backends.c
+1
@@ -697,6 +697,7 @@ void *backends_main(void *ptr) {
697 // prepare the backend main loop
698
699 info("BACKEND: configured ('%s' on '%s' sending '%s' data, every %d seconds, as host '%s', with prefix '%s')", type, destination, source, global_backend_update_every, hostname, global_backend_prefix);
700 + send_statistics("BACKEND_START", "OK", type);
701
702 usec_t step_ut = global_backend_update_every * USEC_PER_SEC;
703 time_t after = now_realtime_sec();
exporting/exporting_engine.c
+1
@@ -84,6 +84,7 @@ void *exporting_main(void *ptr)
84
85 if (init_connectors(engine) != 0) {
86 error("EXPORTING: cannot initialize exporting connectors");
87 + send_statistics("EXPORTING_START", "FAIL", "-");
88 goto cleanup;
89 }
90
exporting/exporting_engine.h
+1
@@ -59,6 +59,7 @@ struct engine;
59
60 struct instance_config {
61 EXPORTING_CONNECTOR_TYPE type;
62 + const char *type_name;
63
64 const char *name;
65 const char *destination;
exporting/init_connectors.c
+2
@@ -90,6 +90,8 @@ int init_connectors(struct engine *engine)
90 char threadname[NETDATA_THREAD_NAME_MAX + 1];
91 snprintfz(threadname, NETDATA_THREAD_NAME_MAX, "EXPORTING-%zu", instance->index);
92 uv_thread_set_name_np(instance->thread, threadname);
93 +
94 + send_statistics("EXPORTING_START", "OK", instance->config.type_name);
95 }
96
97 return 0;
exporting/read_config.c
+1
@@ -336,6 +336,7 @@ struct engine *read_exporting_config()
336
337 instance_name = tmp_ci_list->local_ci.instance_name;
338
339 + tmp_instance->config.type_name = strdupz(tmp_ci_list->local_ci.connector_name);
340 tmp_instance->config.name = strdupz(tmp_ci_list->local_ci.instance_name);
341
342