diff options
author | Timotej S <6674623+underhood@users.noreply.github.com> | 2022-02-18 12:35:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-18 12:35:01 +0100 |
commit | f3e8c077cfdaebd8073927803a2a4707a302d26a (patch) | |
tree | abfa2b7d852897b5e2a28c441ef10c15bd94b788 /database | |
parent | b6ea74b029f40876c8fc54baea1ee8d1a1f996cb (diff) |
adds install method to /api/v1/info as label (#12040)
* install_type to rrdhost_system_info and as labels
Diffstat (limited to 'database')
-rw-r--r-- | database/rrd.h | 3 | ||||
-rw-r--r-- | database/rrdhost.c | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/database/rrd.h b/database/rrd.h index 3e0daa1691..680a4a055d 100644 --- a/database/rrd.h +++ b/database/rrd.h @@ -756,6 +756,9 @@ struct rrdhost_system_info { uint16_t hops; bool ml_capable; bool ml_enabled; + char *install_type; + char *prebuilt_arch; + char *prebuilt_dist; }; struct rrdhost { diff --git a/database/rrdhost.c b/database/rrdhost.c index 79e283a631..87d8c73259 100644 --- a/database/rrdhost.c +++ b/database/rrdhost.c @@ -834,6 +834,9 @@ void rrdhost_system_info_free(struct rrdhost_system_info *system_info) { freez(system_info->container); freez(system_info->container_detection); freez(system_info->is_k8s_node); + freez(system_info->install_type); + freez(system_info->prebuilt_arch); + freez(system_info->prebuilt_dist); freez(system_info); } } @@ -1071,6 +1074,18 @@ static struct label *rrdhost_load_auto_labels(void) label_list = add_label_to_list(label_list, "_is_k8s_node", localhost->system_info->is_k8s_node, LABEL_SOURCE_AUTO); + if (localhost->system_info->install_type) + label_list = + add_label_to_list(label_list, "_install_type", localhost->system_info->install_type, LABEL_SOURCE_AUTO); + + if (localhost->system_info->prebuilt_arch) + label_list = + add_label_to_list(label_list, "_prebuilt_arch", localhost->system_info->prebuilt_arch, LABEL_SOURCE_AUTO); + + if (localhost->system_info->prebuilt_dist) + label_list = + add_label_to_list(label_list, "_prebuilt_dist", localhost->system_info->prebuilt_dist, LABEL_SOURCE_AUTO); + label_list = add_aclk_host_labels(label_list); label_list = add_label_to_list( |