]> arthur.barton.de Git - netdata.git/commitdiff
Added more members to the json output:
authorLuis Felipe Dominguez Vega <ldominguezvega@gmail.com>
Fri, 17 Feb 2017 20:50:05 +0000 (15:50 -0500)
committerLuis Felipe Dominguez Vega <ldominguezvega@gmail.com>
Fri, 17 Feb 2017 20:50:05 +0000 (15:50 -0500)
Like this: #1497 (comment)

src/backends.c

index 9f7e54cc3435fba8ff580b92cd51b7b9c6ff0025..7d73917bb0ec75ef1833351980ad3ac732ca4ea0 100644 (file)
@@ -101,10 +101,17 @@ static inline int format_dimension_collected_json_plaintext(BUFFER *b, const cha
     buffer_sprintf(b, "{"
         "\"prefix\":\"%s\","
         "\"hostname\":\"%s\","
+
+        "\"type\":\"%s\","
+        "\"family\":\"%s\","
+        "\"context\": \"%s\","
+        "\"units\": \"%s\","
+        "\"title\": \"%s\","
+
         "\"id\":\"%s\","
         "\"subid\":\"%s\","
         "\"value\":" COLLECTED_NUMBER_FORMAT ","
-        "\"timestamp\": %u}\n", prefix, hostname, st->id, rd->id, rd->last_collected_value, (uint32_t)rd->last_collected_time.tv_sec);
+        "\"timestamp\": %u}\n", prefix, hostname, st->type, st->family, st->context, st->units, st->title, st->id, rd->id, rd->last_collected_value, (uint32_t)rd->last_collected_time.tv_sec);
     return 1;
 }
 
@@ -115,10 +122,17 @@ static inline int format_dimension_stored_json_plaintext(BUFFER *b, const char *
         buffer_sprintf(b, "{"
             "\"prefix\":\"%s\","
             "\"hostname\":\"%s\","
+
+            "\"type\":\"%s\","
+            "\"family\":\"%s\","
+            "\"context\": \"%s\","
+            "\"units\": \"%s\","
+            "\"title\": \"%s\","
+
             "\"id\":\"%s\","
             "\"subid\":\"%s\","
             "\"value\":" CALCULATED_NUMBER_FORMAT ","
-            "\"timestamp\": %u}\n", prefix, hostname, st->id, rd->id, value, (uint32_t) before);
+            "\"timestamp\": %u}\n", prefix, hostname, st->type, st->family, st->context, st->units, st->title, st->id, rd->id, value, (uint32_t)before);
         return 1;
     }
     return 0;