diff options
author | Timotej S <6674623+underhood@users.noreply.github.com> | 2022-10-11 12:27:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 12:27:42 +0200 |
commit | 4a935930abe0cbed5aa5f9b583e91fdaf4278223 (patch) | |
tree | 16849c39042fa70a17462e8534e5f4ea44aac0cc /health | |
parent | 8ae9a6eb93410cb3bb620013701318f83351c128 (diff) |
minor - add host labels for ephemerality and nodes with unstable connections (#13784)
* add host labels for ephemerality and nodes with unstable connections
Diffstat (limited to 'health')
-rw-r--r-- | health/health.c | 10 | ||||
-rw-r--r-- | health/health.h | 2 |
2 files changed, 12 insertions, 0 deletions
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 |