diff options
author | Erdem Ergen <erdem@netdata.cloud> | 2022-03-31 00:02:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 00:02:41 +0300 |
commit | 382e021d47b61e050c595e999ed7c9fa378786ac (patch) | |
tree | dd80144d736c79df9cef0685fb9c4ee9e3c8a5b2 /web | |
parent | 1381fbb5977413e4f400c357ea1b09fac4e404d1 (diff) |
[Agent crash on api/v1/info call] - fixes #12559 (#12565)
* [Agent crash on api/v1/info call] - fixes #12559
returns boolean values
updated swagger files
Diffstat (limited to 'web')
-rw-r--r-- | web/api/netdata-swagger.json | 7 | ||||
-rw-r--r-- | web/api/netdata-swagger.yaml | 5 | ||||
-rw-r--r-- | web/api/web_api_v1.c | 12 |
3 files changed, 19 insertions, 5 deletions
diff --git a/web/api/netdata-swagger.json b/web/api/netdata-swagger.json index 4a2d16eb34..0569e515a0 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, 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", + "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* Streaming information\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.", @@ -1220,6 +1220,11 @@ "description": "Container technology detection method.", "example": "dockerenv" }, + "stream_compression": { + "type": "boolean", + "description": "Stream transmission compression method.", + "example": "true" + }, "labels": { "type": "object", "description": "List of host labels.", diff --git a/web/api/netdata-swagger.yaml b/web/api/netdata-swagger.yaml index 80d2bfdfeb..7d052c26f9 100644 --- a/web/api/netdata-swagger.yaml +++ b/web/api/netdata-swagger.yaml @@ -14,6 +14,7 @@ paths: * list of hosts mirrored (includes itself) * Operating System, Virtualization, K8s nodes and Container technology information * List of active collector plugins and modules + * Streaming information * number of alarms in the host * number of alarms in normal state * number of alarms in warning state @@ -984,6 +985,10 @@ components: type: string description: Container technology detection method. example: dockerenv + stream_compression: + type: boolean + description: Stream transmission compression method. + example: true labels: type: object description: List of host labels. diff --git a/web/api/web_api_v1.c b/web/api/web_api_v1.c index 4a5378db28..d00dc355f5 100644 --- a/web/api/web_api_v1.c +++ b/web/api/web_api_v1.c @@ -1050,11 +1050,15 @@ inline int web_client_api_request_v1_info_fill_buffer(RRDHOST *host, BUFFER *wb) buffer_strcat(wb, ",\n"); #ifdef ENABLE_COMPRESSION - buffer_strcat(wb, "\t\"stream-compression\": "); - buffer_strcat(wb, (host->sender->rrdpush_compression ? "\"enabled\"" : "\"disabled\"")); - buffer_strcat(wb, ",\n"); + if(host->sender){ + buffer_strcat(wb, "\t\"stream-compression\": "); + buffer_strcat(wb, (host->sender->rrdpush_compression ? "true" : "false")); + buffer_strcat(wb, ",\n"); + }else{ + buffer_strcat(wb, "\t\"stream-compression\": null,\n"); + } #else - buffer_strcat(wb, "\t\"stream-compression\": \"N/A\",\n"); + buffer_strcat(wb, "\t\"stream-compression\": null,\n"); #endif //ENABLE_COMPRESSION buffer_strcat(wb, "\t\"hosts-available\": "); |