strbuf_printf(buf, "\n");
}
}
-
STRBUF_DESTROY(family_name);
+
+ strbuf_printf(buf, "\n");
}
/* target_info prints a special "info" metric that contains all the "target
}
c_avl_iterator_destroy(iter);
- strbuf_printf(buf, "\n# collectd/write_prometheus %s at %s\n",
- PACKAGE_VERSION, hostname_g);
+ strbuf_printf(buf, "# collectd/write_prometheus %s at %s\n", PACKAGE_VERSION,
+ hostname_g);
pthread_mutex_unlock(&prom_metrics_lock);
}
},
.want = "# HELP unit_test_total\n"
"# TYPE unit_test_total counter\n"
- "unit_test_total 42\n",
+ "unit_test_total 42\n"
+ "\n",
},
{
.name = "metric with one label",
},
.want = "# HELP unittest\n"
"# TYPE unittest gauge\n"
- "unittest{foo=\"bar\"} 42\n",
+ "unittest{foo=\"bar\"} 42\n"
+ "\n",
},
{
.name = "invalid characters are replaced",
},
.want = "# HELP unit_test\n"
"# TYPE unit_test untyped\n"
- "unit_test{metric_name=\"unit.test\"} 42\n",
+ "unit_test{metric_name=\"unit.test\"} 42\n"
+ "\n",
},
{
.name = "most resource attributes are ignored",
.want = "# HELP unit_test\n"
"# TYPE unit_test untyped\n"
"unit_test{job=\"service name\",instance=\"service instance "
- "id\",metric_name=\"unit.test\"} 42\n",
+ "id\",metric_name=\"unit.test\"} 42\n"
+ "\n",
},
};