diff options
Diffstat (limited to '')
-rw-r--r-- | src/exporting/exporting_engine.c (renamed from exporting/exporting_engine.c) | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/exporting/exporting_engine.c b/src/exporting/exporting_engine.c index f42a36e92..eb5f8a0a8 100644 --- a/exporting/exporting_engine.c +++ b/src/exporting/exporting_engine.c @@ -51,7 +51,7 @@ void analytics_exporting_connectors(BUFFER *b) buffer_strcat(b, "OpenTSDBHTTP"); break; case EXPORTING_CONNECTOR_TYPE_PROMETHEUS_REMOTE_WRITE: -#if ENABLE_PROMETHEUS_REMOTE_WRITE +#ifdef ENABLE_PROMETHEUS_REMOTE_WRITE buffer_strcat(b, "PrometheusRemoteWrite"); #endif break; @@ -66,7 +66,7 @@ void analytics_exporting_connectors(BUFFER *b) #endif break; case EXPORTING_CONNECTOR_TYPE_MONGODB: -#if HAVE_MONGOC +#ifdef HAVE_MONGOC buffer_strcat(b, "MongoDB"); #endif break; @@ -95,7 +95,7 @@ static void exporting_clean_engine() aws_sdk_shutdown(); #endif -#if ENABLE_PROMETHEUS_REMOTE_WRITE +#ifdef ENABLE_PROMETHEUS_REMOTE_WRITE if (engine->protocol_buffers_initialized) protocol_buffers_shutdown(); #endif @@ -119,9 +119,11 @@ static void exporting_clean_engine() * * @param ptr thread data. */ -static void exporting_main_cleanup(void *ptr) +static void exporting_main_cleanup(void *pptr) { - struct netdata_static_thread *static_thread = (struct netdata_static_thread *)ptr; + struct netdata_static_thread *static_thread = CLEANUP_FUNCTION_GET_PTR(pptr); + if(!static_thread) return; + static_thread->enabled = NETDATA_MAIN_THREAD_EXITING; netdata_log_info("cleaning up..."); @@ -174,7 +176,7 @@ static void exporting_main_cleanup(void *ptr) */ void *exporting_main(void *ptr) { - netdata_thread_cleanup_push(exporting_main_cleanup, ptr); + CLEANUP_FUNCTION_REGISTER(exporting_main_cleanup) cleanup_ptr = ptr; engine = read_exporting_config(); if (!engine) { @@ -184,7 +186,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; } @@ -212,6 +216,5 @@ void *exporting_main(void *ptr) } cleanup: - netdata_thread_cleanup_pop(1); return NULL; } |