diff --git a/aclk/aclk_tx_msgs.c b/aclk/aclk_tx_msgs.c index 69cb5856c5..d7254fe596 100644 --- a/aclk/aclk_tx_msgs.c +++ b/aclk/aclk_tx_msgs.c @@ -459,6 +459,7 @@ uint16_t aclk_send_agent_connection_update(mqtt_wss_client client, int reachable #ifdef ENABLE_ML { .name = "ml", .version = 1, .enabled = ml_enabled(localhost) }, #endif + { .name = "mc", .version = enable_metric_correlations ? metric_correlations_version : 0, .enabled = enable_metric_correlations }, { .name = NULL, .version = 0, .enabled = 0 } }; diff --git a/database/metric_correlations.c b/database/metric_correlations.c index a6d543ee18..3b8968c99d 100644 --- a/database/metric_correlations.c +++ b/database/metric_correlations.c @@ -4,7 +4,8 @@ #include "KolmogorovSmirnovDist.h" #define MAX_POINTS 10000 -int enable_metric_correlations = CONFIG_BOOLEAN_YES; +int enable_metric_correlations = CONFIG_BOOLEAN_NO; +int metric_correlations_version = 1; struct charts { RRDSET *st; diff --git a/database/metric_correlations.h b/database/metric_correlations.h index 73b246fde1..83ea9b74d9 100644 --- a/database/metric_correlations.h +++ b/database/metric_correlations.h @@ -4,6 +4,7 @@ #define NETDATA_METRIC_CORRELATIONS_H 1 extern int enable_metric_correlations; +extern int metric_correlations_version; void metric_correlations (RRDHOST *host, BUFFER *wb, long long selected_after, long long selected_before, long long reference_after, long long reference_before, long long max_points); diff --git a/database/rrd.h b/database/rrd.h index 4f0073e962..585a62452e 100644 --- a/database/rrd.h +++ b/database/rrd.h @@ -718,6 +718,7 @@ struct rrdhost_system_info { char *install_type; char *prebuilt_arch; char *prebuilt_dist; + int mc_version; }; struct rrdhost { diff --git a/database/rrdhost.c b/database/rrdhost.c index 823abccb8e..4494fdf01f 100644 --- a/database/rrdhost.c +++ b/database/rrdhost.c @@ -392,6 +392,7 @@ RRDHOST *rrdhost_create(const char *hostname, if (is_localhost && host->system_info) { host->system_info->ml_capable = ml_capable(); host->system_info->ml_enabled = ml_enabled(host); + host->system_info->mc_version = enable_metric_correlations ? metric_correlations_version : 0; } ml_new_host(host); diff --git a/database/sqlite/sqlite_aclk_node.c b/database/sqlite/sqlite_aclk_node.c index 028718febf..c451c41d4d 100644 --- a/database/sqlite/sqlite_aclk_node.c +++ b/database/sqlite/sqlite_aclk_node.c @@ -28,6 +28,7 @@ void sql_build_node_info(struct aclk_database_worker_config *wc, struct aclk_dat struct capability instance_caps[] = { { .name = "proto", .version = 1, .enabled = 1 }, { .name = "ml", .version = ml_capable(localhost), .enabled = ml_enabled(wc->host) }, + { .name = "mc", .version = enable_metric_correlations ? metric_correlations_version : 0, .enabled = enable_metric_correlations }, { .name = NULL, .version = 0, .enabled = 0 } }; node_info.node_instance_capabilities = instance_caps; @@ -66,6 +67,7 @@ void sql_build_node_info(struct aclk_database_worker_config *wc, struct aclk_dat struct capability node_caps[] = { { .name = "ml", .version = host->system_info->ml_capable, .enabled = host->system_info->ml_enabled }, + { .name = "mc", .version = host->system_info->mc_version ? host->system_info->mc_version : 0, .enabled = host->system_info->mc_version ? 1 : 0 }, { .name = NULL, .version = 0, .enabled = 0 } }; node_info.node_capabilities = node_caps; diff --git a/streaming/rrdpush.c b/streaming/rrdpush.c index 783226066a..77774d8d3b 100644 --- a/streaming/rrdpush.c +++ b/streaming/rrdpush.c @@ -615,6 +615,8 @@ int rrdpush_receiver_thread_spawn(struct web_client *w, char *url) { system_info->ml_capable = strtoul(value, NULL, 0); else if(!strcmp(name, "ml_enabled")) system_info->ml_enabled = strtoul(value, NULL, 0); + else if(!strcmp(name, "mc_version")) + system_info->mc_version = strtoul(value, NULL, 0); else if(!strcmp(name, "tags")) tags = value; else if(!strcmp(name, "ver")) diff --git a/streaming/sender.c b/streaming/sender.c index 88febc0447..a95cc86734 100644 --- a/streaming/sender.c +++ b/streaming/sender.c @@ -335,6 +335,7 @@ if(!s->rrdpush_compression) "&hops=%d" "&ml_capable=%d" "&ml_enabled=%d" + "&mc_version=%d" "&tags=%s" "&ver=%d" "&NETDATA_INSTANCE_CLOUD_TYPE=%s" @@ -380,6 +381,7 @@ if(!s->rrdpush_compression) , host->system_info->hops + 1 , host->system_info->ml_capable , host->system_info->ml_enabled + , host->system_info->mc_version , (host->tags) ? host->tags : "" , s->version , (host->system_info->cloud_provider_type) ? host->system_info->cloud_provider_type : ""