summaryrefslogtreecommitdiffstats
path: root/exporting
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2022-02-24 10:57:30 +0200
committerGitHub <noreply@github.com>2022-02-24 10:57:30 +0200
commit69ea17d6ec534e1ed796a92fd042bd76a3ca9215 (patch)
tree4345e3405b2ac1e37a9be1615d6dad799e15327d /exporting
parent8756eb80c77caf411f7fae605d3f1bb03dd60b76 (diff)
Track anomaly rates with DBEngine. (#12083)
* Track anomaly rates with DBEngine. This commit adds support for tracking anomaly rates with DBEngine. We do so by creating a single chart with id "anomaly_detection.anomaly_rates" for each trainable/predictable host, which is responsible for tracking the anomaly rate of each dimension that we train/predict for that host. The rrdset->state->is_ar_chart boolean flag is set to true only for anomaly rates charts. We use this flag to: - Disable exposing the anomaly rates charts through the functionality in backends/, exporting/ and streaming/. - Skip generation of configuration options for the name, algorithm, multiplier, divisor of each dimension in an anomaly rates chart. - Skip the creation of health variables for anomaly rates dimensions. - Skip the chart/dim queue of ACLK. - Post-process the RRDR result of an anomaly rates chart, so that we can return a sorted, trimmed number of anomalous dimensions. In a child/parent configuration where both the child and the parent run ML for the child, we want to be able to stream the rest of the ML-related charts to the parent. To be able to do this without any chart name collisions, the charts are now created on localhost and their IDs and titles have the node's machine_guid and hostname as a suffix, respectively. * Fix exporting_engine tests. * Restore default ML configuration. The reverted changes where meant for local testing only. This commit restores the default values that we want to have when someone runs anomaly detection on their node. * Set context for anomaly_detection.* charts. * Check for anomaly rates chart only with a valid pointer. * Remove duplicate code. * Use a more descriptive name for id/title pair variable
Diffstat (limited to 'exporting')
-rw-r--r--exporting/check_filters.c4
-rw-r--r--exporting/prometheus/prometheus.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/exporting/check_filters.c b/exporting/check_filters.c
index d2d7d870fb..4e38d43d7f 100644
--- a/exporting/check_filters.c
+++ b/exporting/check_filters.c
@@ -47,6 +47,10 @@ int rrdset_is_exportable(struct instance *instance, RRDSET *st)
RRDHOST *host = st->rrdhost;
#endif
+ // Do not export anomaly rates charts.
+ if (st->state && st->state->is_ar_chart)
+ return 0;
+
if (st->exporting_flags == NULL)
st->exporting_flags = callocz(instance->engine->instance_num, sizeof(size_t));
diff --git a/exporting/prometheus/prometheus.c b/exporting/prometheus/prometheus.c
index 0a3190074b..87fa8cd5e8 100644
--- a/exporting/prometheus/prometheus.c
+++ b/exporting/prometheus/prometheus.c
@@ -20,6 +20,10 @@ inline int can_send_rrdset(struct instance *instance, RRDSET *st)
RRDHOST *host = st->rrdhost;
#endif
+ // Do not send anomaly rates charts.
+ if (st->state && st->state->is_ar_chart)
+ return 0;
+
if (unlikely(rrdset_flag_check(st, RRDSET_FLAG_EXPORTING_IGNORE)))
return 0;