@cryptotaxi247 / netdata-1 / commits / ae5a49e16

Added more members to the json output:

Like this: #1497 (comment)

Luis Felipe Dominguez Vega committed Feb 17, 2017 at 15:50 UTC ae5a49e16f0c5932d8eba6670a75c5d7e1292312
1 file changed +16 -2
src/backends.c
+16 -2
@@ -101,10 +101,17 @@ static inline int format_dimension_collected_json_plaintext(BUFFER *b, const cha
101 buffer_sprintf(b, "{"
102 "\"prefix\":\"%s\","
103 "\"hostname\":\"%s\","
104 +
105 + "\"type\":\"%s\","
106 + "\"family\":\"%s\","
107 + "\"context\": \"%s\","
108 + "\"units\": \"%s\","
109 + "\"title\": \"%s\","
110 +
111 "\"id\":\"%s\","
112 "\"subid\":\"%s\","
113 "\"value\":" COLLECTED_NUMBER_FORMAT ","
107 - "\"timestamp\": %u}\n", prefix, hostname, st->id, rd->id, rd->last_collected_value, (uint32_t)rd->last_collected_time.tv_sec);
114 + "\"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);
115 return 1;
116 }
117
@@ -115,10 +122,17 @@ static inline int format_dimension_stored_json_plaintext(BUFFER *b, const char *
122 buffer_sprintf(b, "{"
123 "\"prefix\":\"%s\","
124 "\"hostname\":\"%s\","
125 +
126 + "\"type\":\"%s\","
127 + "\"family\":\"%s\","
128 + "\"context\": \"%s\","
129 + "\"units\": \"%s\","
130 + "\"title\": \"%s\","
131 +
132 "\"id\":\"%s\","
133 "\"subid\":\"%s\","
134 "\"value\":" CALCULATED_NUMBER_FORMAT ","
121 - "\"timestamp\": %u}\n", prefix, hostname, st->id, rd->id, value, (uint32_t) before);
135 + "\"timestamp\": %u}\n", prefix, hostname, st->type, st->family, st->context, st->units, st->title, st->id, rd->id, value, (uint32_t)before);
136 return 1;
137 }
138 return 0;