summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 375061c)
raw | patch | inline | side by side (parent: 375061c)
author | Pavel Rochnyack <pavel2000@ngs.ru> | |
Mon, 16 Oct 2017 12:46:06 +0000 (19:46 +0700) | ||
committer | Pavel Rochnyack <pavel2000@ngs.ru> | |
Mon, 16 Oct 2017 12:46:06 +0000 (19:46 +0700) |
src/utils_format_kairosdb.c | patch | blob | history | |
src/write_http.c | patch | blob | history |
index c870abb4f6ca7b84f011b575b447fb792a48a3ea..460f807a5631c5be49f75f8efe68c2e3452882fa 100644 (file)
for (size_t i = 0; i < ds->ds_num; i++) {
/* All value lists have a leading comma. The first one will be replaced with
* a square bracket in `format_kairosdb_finalize'. */
- BUFFER_ADD(",{");
+ BUFFER_ADD(",{\"name\":\"");
- BUFFER_ADD("\"name\":\"%s", metrics_prefix);
+ if (metrics_prefix != NULL) {
+ BUFFER_ADD("%s.", metrics_prefix);
+ }
- BUFFER_ADD(".%s", vl->plugin);
+ BUFFER_ADD("%s", vl->plugin);
status = values_to_kairosdb(temp, sizeof(temp), ds, vl, store_rates, i);
if (status != 0)
diff --git a/src/write_http.c b/src/write_http.c
index 16a21e65a991825d98873c7d4ae4ff4307e77349..87e518b6857605a814abed1460a014958dc016ec 100644 (file)
--- a/src/write_http.c
+++ b/src/write_http.c
return -1;
}
+ if (strlen(cb->metrics_prefix) == 0)
+ sfree(cb->metrics_prefix);
+
if (cb->low_speed_limit > 0)
cb->low_speed_time = CDTIME_T_TO_TIME_T(plugin_get_interval());