diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2021-01-18 15:44:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-18 07:44:14 -0500 |
commit | 10b745cba808ed2069ae51c23d75c02cf3ca3f65 (patch) | |
tree | 191cbb9fb1a93a739383a39a1cf2b838d1f035f5 /web | |
parent | f4193c3b5c013df00b6d05805bf1cc99bebe02bf (diff) |
add `_is_k8s_node` label to the host labels (#10501)
* auto format system-info.sh
* detect whether the node is k8s node in system-info.sh
* fix unmae=>uname
* add_is_k8s_node_to_host_labels: Add new variable to structure
* add_is_k8s_node_to_host_labels: Add is_k8_node to labels
* add_is_k8s_node_to_host_labels: Add is_k8_node inside endpoint
* add_is_k8s_node_to_host_labels: Add data to swagge file
* change yes/no to true/false
* Update web/api/netdata-swagger.json
* add_is_k8s_node_to_host_labels: Add anonymous statistic
* add_is_k8s_node_to_host_labels: Add information to using-host-labels.md
* add_is_k8s_node_to_host_labels: Add variable to stream
* add_is_k8s_node_to_host_labels: Change swagger.yaml
* add_is_k8s_node_to_host_labels: Adding missing documentation
* add_is_k8s_node_to_host_labels: rename variable
* add_is_k8s_node_to_host_labels: Rename lables to match variable names
* add_is_k8s_node_to_host_labels: Add to wget
* add_is_k8s_node_to_host_labels: Add content to swagger files
* add_is_k8s_node_to_host_labels: update both swagger files
* add_is_k8s_node_to_host_labels: fix wrong exportation
Co-authored-by: Thiago Marques <thiagoftsm@gmail.com>
Diffstat (limited to 'web')
-rw-r--r-- | web/api/netdata-swagger.json | 7 | ||||
-rw-r--r-- | web/api/netdata-swagger.yaml | 6 | ||||
-rw-r--r-- | web/api/web_api_v1.c | 2 |
3 files changed, 13 insertions, 2 deletions
diff --git a/web/api/netdata-swagger.json b/web/api/netdata-swagger.json index 47f5fe379d..ed2555f830 100644 --- a/web/api/netdata-swagger.json +++ b/web/api/netdata-swagger.json @@ -9,7 +9,7 @@ "/info": { "get": { "summary": "Get netdata basic information", - "description": "The info endpoint returns basic information about netdata. It provides:\n* netdata version\n* netdata unique id\n* list of hosts mirrored (includes itself)\n* Operating System, Virtualization and Container technology information\n* List of active collector plugins and modules\n* number of alarms in the host\n * number of alarms in normal state\n * number of alarms in warning state\n * number of alarms in critical state\n", + "description": "The info endpoint returns basic information about netdata. It provides:\n* netdata version\n* netdata unique id\n* list of hosts mirrored (includes itself)\n* Operating System, Virtualization, K8s nodes and Container technology information\n* List of active collector plugins and modules\n* number of alarms in the host\n * number of alarms in normal state\n * number of alarms in warning state\n * number of alarms in critical state\n", "responses": { "200": { "description": "netdata basic information.", @@ -1172,6 +1172,11 @@ "description": "Kernel Version.", "example": "4.19.32-1-MANJARO" }, + "is_k8s_node": { + "type": "boolean", + "description": "Netdata is running on a K8s node.", + "example": false + }, "architecture": { "type": "string", "description": "Kernel architecture.", diff --git a/web/api/netdata-swagger.yaml b/web/api/netdata-swagger.yaml index 8ccf299812..748274216f 100644 --- a/web/api/netdata-swagger.yaml +++ b/web/api/netdata-swagger.yaml @@ -12,7 +12,7 @@ paths: * netdata version * netdata unique id * list of hosts mirrored (includes itself) - * Operating System, Virtualization and Container technology information + * Operating System, Virtualization, K8s nodes and Container technology information * List of active collector plugins and modules * number of alarms in the host * number of alarms in normal state @@ -948,6 +948,10 @@ components: type: string description: Kernel Version. example: 4.19.32-1-MANJARO + is_k8s_node: + type: boolean + description: Netdata is running on a K8s node. + example: false architecture: type: string description: Kernel architecture. diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c index 4287675418..73ac15d30d 100644 --- a/web/api/web_api_v1.c +++ b/web/api/web_api_v1.c @@ -933,6 +933,8 @@ inline int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb) buffer_sprintf(wb, "\t\"container_os_version_id\": \"%s\",\n", host->system_info->container_os_version_id); if (host->system_info->container_os_detection) buffer_sprintf(wb, "\t\"container_os_detection\": \"%s\",\n", host->system_info->container_os_detection); + if (host->system_info->is_k8s_node) + buffer_sprintf(wb, "\t\"is_k8s_node\": \"%s\",\n", host->system_info->is_k8s_node); buffer_sprintf(wb, "\t\"kernel_name\": \"%s\",\n", (host->system_info->kernel_name) ? host->system_info->kernel_name : ""); buffer_sprintf(wb, "\t\"kernel_version\": \"%s\",\n", (host->system_info->kernel_version) ? host->system_info->kernel_version : ""); |