summaryrefslogtreecommitdiff
path: root/src/exporter/cjson_exporter.c
diff options
context:
space:
mode:
authorchenzizhan <[email protected]>2023-11-14 14:56:03 +0800
committerchenzizhan <[email protected]>2023-11-14 14:56:03 +0800
commit706e5dc7a2615cec0dc2a1bf9eddcff9a391855c (patch)
tree51aa2294b9ed76567ddff3f6ca1a8e82f6113d96 /src/exporter/cjson_exporter.c
parenta619037a074dd57398d185cd2e2154bb991d2c2b (diff)
fieldstat easy name
Diffstat (limited to 'src/exporter/cjson_exporter.c')
-rw-r--r--src/exporter/cjson_exporter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/exporter/cjson_exporter.c b/src/exporter/cjson_exporter.c
index 9b98958..c519ca7 100644
--- a/src/exporter/cjson_exporter.c
+++ b/src/exporter/cjson_exporter.c
@@ -860,8 +860,9 @@ void fieldstat_json_exporter_export_array(const struct fieldstat_json_exporter *
for (int j = 0; j < tag_field_pair[i].n_metric; j++) {
kv_pair_write_to_json(tag_field_pair[i].metric_pairs[j], field_json);
}
- struct json_writer *field_json_delta = json_writer_init();
+ struct json_writer *field_json_delta = NULL;
if (exporter->history != NULL) { // not null when fieldstat_json_exporter_enable_delta is called
+ struct json_writer *field_json_delta = json_writer_init();
write_delta_to_json((struct fieldstat_json_exporter *)exporter, &tag_field_pair[i], field_json_delta);
}