prometheus: always send host tags with netdata_host_tags
Costa Tsaousis (ktsaou) committed
Jul 9, 2017 at 13:08 UTC
66371f0d7b196680d5f6254536589327b43ce129
1 file changed
+3
-3
src/rrd2json.c
+3
-3
@@ -216,9 +216,9 @@ void rrd_stats_api_v1_charts_allmetrics_prometheus(RRDHOST *host, BUFFER *wb, in
216
char labels[PROMETHEUS_LABELS_MAX + 1] = "";
217
if(allhosts) {
218
if(host->tags && *(host->tags))
219
- snprintfz(labels, PROMETHEUS_LABELS_MAX, ",instance=\"%s\",%s", hostname, host->tags);
220
- else
221
- snprintfz(labels, PROMETHEUS_LABELS_MAX, ",instance=\"%s\"", hostname);
219
+ buffer_sprintf(wb, "netdata_host_tags{instance=\"%s\",%s} 1 %llu\n", hostname, host->tags, now_realtime_usec() / USEC_PER_MS);
220
+
221
+ snprintfz(labels, PROMETHEUS_LABELS_MAX, ",instance=\"%s\"", hostname);
222
}
223
else {
224
if(host->tags && *(host->tags))