summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimotej S <6674623+underhood@users.noreply.github.com>2022-10-11 12:27:42 +0200
committerGitHub <noreply@github.com>2022-10-11 12:27:42 +0200
commit4a935930abe0cbed5aa5f9b583e91fdaf4278223 (patch)
tree16849c39042fa70a17462e8534e5f4ea44aac0cc
parent8ae9a6eb93410cb3bb620013701318f83351c128 (diff)
minor - add host labels for ephemerality and nodes with unstable connections (#13784)
* add host labels for ephemerality and nodes with unstable connections
-rw-r--r--database/rrdhost.c2
-rw-r--r--health/health.c10
-rw-r--r--health/health.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/database/rrdhost.c b/database/rrdhost.c
index 0249d3ec47..4a083f9c91 100644
--- a/database/rrdhost.c
+++ b/database/rrdhost.c
@@ -1303,6 +1303,8 @@ static void rrdhost_load_auto_labels(void) {
add_aclk_host_labels();
+ health_add_host_labels();
+
rrdlabels_add(
labels, "_is_parent", (rrdhost_hosts_available() > 1 || configured_as_parent()) ? "true" : "false", RRDLABEL_SRC_AUTO);
diff --git a/health/health.c b/health/health.c
index 05dd2ca010..56ae574831 100644
--- a/health/health.c
+++ b/health/health.c
@@ -1307,3 +1307,13 @@ void *health_main(void *ptr) {
netdata_thread_cleanup_pop(1);
return NULL;
}
+
+void health_add_host_labels(void) {
+ DICTIONARY *labels = localhost->rrdlabels;
+
+ int is_ephemeral = appconfig_get_boolean(&netdata_config, CONFIG_SECTION_HEALTH, "is ephemeral", CONFIG_BOOLEAN_NO);
+ rrdlabels_add(labels, "_is_ephemeral", is_ephemeral ? "true" : "false", RRDLABEL_SRC_CONFIG);
+
+ int has_unstable_connection = appconfig_get_boolean(&netdata_config, CONFIG_SECTION_HEALTH, "has unstable connection", CONFIG_BOOLEAN_NO);
+ rrdlabels_add(labels, "_has_unstable_connection", has_unstable_connection ? "true" : "false", RRDLABEL_SRC_CONFIG);
+}
diff --git a/health/health.h b/health/health.h
index fc6a874e9f..0af7e0755f 100644
--- a/health/health.h
+++ b/health/health.h
@@ -90,4 +90,6 @@ void health_label_log_save(RRDHOST *host);
char *health_edit_command_from_source(const char *source);
void sql_refresh_hashes(void);
+void health_add_host_labels(void);
+
#endif //NETDATA_HEALTH_H