summaryrefslogtreecommitdiffstats
path: root/exporting/json
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-30 18:47:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-30 18:47:00 +0000
commit03bf87dcb06f7021bfb2df2fa8691593c6148aff (patch)
treee16b06711a2ed77cafb4b7754be0220c3d14a9d7 /exporting/json
parentAdding upstream version 1.36.1. (diff)
downloadnetdata-upstream/1.37.0.tar.xz
netdata-upstream/1.37.0.zip
Adding upstream version 1.37.0.upstream/1.37.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'exporting/json')
-rw-r--r--exporting/json/json.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/exporting/json/json.c b/exporting/json/json.c
index 45a8c9d9f..dd53f6f0a 100644
--- a/exporting/json/json.c
+++ b/exporting/json/json.c
@@ -125,7 +125,7 @@ int format_host_labels_json_plaintext(struct instance *instance, RRDHOST *host)
return 0;
buffer_strcat(instance->labels_buffer, "\"labels\":{");
- rrdlabels_to_buffer(host->host_labels, instance->labels_buffer, "", ":", "\"", ",",
+ rrdlabels_to_buffer(host->rrdlabels, instance->labels_buffer, "", ":", "\"", ",",
exporting_labels_filter_callback, instance,
NULL, sanitize_json_string);
buffer_strcat(instance->labels_buffer, "},");
@@ -145,7 +145,7 @@ int format_dimension_collected_json_plaintext(struct instance *instance, RRDDIM
RRDSET *st = rd->rrdset;
RRDHOST *host = st->rrdhost;
- const char *tags_pre = "", *tags_post = "", *tags = host->tags;
+ const char *tags_pre = "", *tags_post = "", *tags = rrdhost_tags(host);
if (!tags)
tags = "";
@@ -187,21 +187,20 @@ int format_dimension_collected_json_plaintext(struct instance *instance, RRDDIM
"\"timestamp\":%llu}",
instance->config.prefix,
- (host == localhost) ? instance->config.hostname : host->hostname,
+ (host == localhost) ? instance->config.hostname : rrdhost_hostname(host),
tags_pre,
tags,
tags_post,
instance->labels_buffer ? buffer_tostring(instance->labels_buffer) : "",
- st->id,
- st->name,
- st->family,
- st->context,
- st->type,
- st->units,
-
- rd->id,
- rd->name,
+ rrdset_id(st),
+ rrdset_name(st),
+ rrdset_family(st),
+ rrdset_context(st),
+ rrdset_parts_type(st),
+ rrdset_units(st),
+ rrddim_id(rd),
+ rrddim_name(rd),
rd->last_collected_value,
(unsigned long long)rd->last_collected_time.tv_sec);
@@ -231,7 +230,7 @@ int format_dimension_stored_json_plaintext(struct instance *instance, RRDDIM *rd
if(isnan(value))
return 0;
- const char *tags_pre = "", *tags_post = "", *tags = host->tags;
+ const char *tags_pre = "", *tags_post = "", *tags = rrdhost_tags(host);
if (!tags)
tags = "";
@@ -272,21 +271,20 @@ int format_dimension_stored_json_plaintext(struct instance *instance, RRDDIM *rd
"\"timestamp\": %llu}",
instance->config.prefix,
- (host == localhost) ? instance->config.hostname : host->hostname,
+ (host == localhost) ? instance->config.hostname : rrdhost_hostname(host),
tags_pre,
tags,
tags_post,
instance->labels_buffer ? buffer_tostring(instance->labels_buffer) : "",
- st->id,
- st->name,
- st->family,
- st->context,
- st->type,
- st->units,
-
- rd->id,
- rd->name,
+ rrdset_id(st),
+ rrdset_name(st),
+ rrdset_family(st),
+ rrdset_context(st),
+ rrdset_parts_type(st),
+ rrdset_units(st),
+ rrddim_id(rd),
+ rrddim_name(rd),
value,
(unsigned long long)last_t);
@@ -346,7 +344,7 @@ void json_http_prepare_header(struct instance *instance)
"\r\n",
instance->config.destination,
simple_connector_data->auth_string ? simple_connector_data->auth_string : "",
- buffer_strlen(simple_connector_data->last_buffer->buffer));
+ (unsigned long int) buffer_strlen(simple_connector_data->last_buffer->buffer));
return;
}