mirror of
https://github.com/netdata/netdata.git
synced 2025-04-25 21:43:55 +00:00
Stream and advertise metric correlations to the cloud (#12940)
* stream and advertise mc to the cloud * better reporting * remove log * remove aclk debug
This commit is contained in:
parent
080e0aee27
commit
2f4b6e059b
8 changed files with 12 additions and 1 deletions
aclk
database
streaming
|
@ -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 }
|
||||
};
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -718,6 +718,7 @@ struct rrdhost_system_info {
|
|||
char *install_type;
|
||||
char *prebuilt_arch;
|
||||
char *prebuilt_dist;
|
||||
int mc_version;
|
||||
};
|
||||
|
||||
struct rrdhost {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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 : ""
|
||||
|
|
Loading…
Add table
Reference in a new issue