@cryptotaxi247 / netdata-1 / commits / c573ad7d5

fix prometeus export: missing comma before "instance" label (#18061)

Ilya Mashchenko committed Jul 2, 2024 at 21:20 UTC c573ad7d51164a37c3e11954a959ef9ea4ece7e3
1 file changed +3 -3
src/exporting/prometheus/prometheus.c
+3 -3
@@ -403,7 +403,7 @@ static int print_host_variables_callback(const DICTIONARY_ITEM *item __maybe_unu
403 opts->prefix,
404 opts->name,
405 label_pre,
406 - opts->labels,
406 + (opts->labels[0] == ',') ? &opts->labels[1] : opts->labels,
407 label_post,
408 value,
409 opts->now * 1000ULL);
@@ -414,7 +414,7 @@ static int print_host_variables_callback(const DICTIONARY_ITEM *item __maybe_unu
414 opts->prefix,
415 opts->name,
416 label_pre,
417 - opts->labels,
417 + (opts->labels[0] == ',') ? &opts->labels[1] : opts->labels,
418 label_post,
419 value);
420
@@ -875,7 +875,7 @@ static void rrd_stats_api_v1_charts_allmetrics_prometheus(
875 .host = host,
876 .wb = wb,
877 .plabels_buffer = plabels_buffer,
878 - .labels = (labels[0] == ',') ? &labels[1] : labels,
878 + .labels = labels, // FIX: very misleading name and poor implementation of adding the "instance" label
879 .exporting_options = exporting_options,
880 .output_options = output_options,
881 .prefix = prefix,