diff options
author | vkalintiris <vasilis@netdata.cloud> | 2023-12-18 21:52:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-18 21:52:17 +0200 |
commit | f56ba4f8d66aea1c783b73fe85a24ade74b5b290 (patch) | |
tree | e64c4ada3b9209b4f1c462228e4066303c79e619 /exporting | |
parent | 1402ab96ea10b56753f4a326db25fe9a333d1fb9 (diff) |
Remove includes outside of libnetdata. (#16607)
* Remove includes outside of libnetdata.
libnetdata ended up using the header daemon/main.h.
This commit tries to resolve this issue by:
- Moving the thread tags under libnetdata/threads/threads.h
- Dropping the definition of `send_analytics` from libnetdata/
and, thus, the requirement for an extra dummy function.
- Adding a new analytics_statistic_send() function.
- Changing netdata_cleanup_and_exit() to accept the raw
parts of an analytics statistic.
After this whole ordeal, only the declaration of
netdata_cleanup_and_exit() is required from libnetdata/
* Fix function hidden under NETDATA_INTERNAL_CHECKS
* Fix field access.
Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
* s/action_data/data/g
* Fix analytics statistics for START/CRASH.
* Pass all args to netdata_cleanup_and_exit in FreeBSD plugin
---------
Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Diffstat (limited to 'exporting')
-rw-r--r-- | exporting/exporting_engine.c | 4 | ||||
-rw-r--r-- | exporting/init_connectors.c | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/exporting/exporting_engine.c b/exporting/exporting_engine.c index 7738dde10d..739c14baf6 100644 --- a/exporting/exporting_engine.c +++ b/exporting/exporting_engine.c @@ -184,7 +184,9 @@ void *exporting_main(void *ptr) if (init_connectors(engine) != 0) { netdata_log_error("EXPORTING: cannot initialize exporting connectors"); - send_statistics("EXPORTING_START", "FAIL", "-"); + + analytics_statistic_t statistic = { "EXPORTING_START", "FAIL", "-" }; + analytics_statistic_send(&statistic); goto cleanup; } diff --git a/exporting/init_connectors.c b/exporting/init_connectors.c index 9dfd11a4cc..165046f673 100644 --- a/exporting/init_connectors.c +++ b/exporting/init_connectors.c @@ -99,7 +99,8 @@ int init_connectors(struct engine *engine) snprintfz(threadname, NETDATA_THREAD_NAME_MAX, "EXPORTING-%zu", instance->index); uv_thread_set_name_np(instance->thread, threadname); - send_statistics("EXPORTING_START", "OK", instance->config.type_name); + analytics_statistic_t statistic = { "EXPORTING_START", "OK", instance->config.type_name }; + analytics_statistic_send(&statistic); } return 0; |