X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_riemann.c;h=805699332d1a13df7dbe14ccff6c7cbc6eddc08c;hb=5a0e9a13ce8a3d49de5a528e09d20b345cb4d744;hp=b35d10eec16dc1d59bae0f0aa0da81886776cd2d;hpb=e3d3699f39ab5f228e1be4ad32fe01b3a307a8ed;p=collectd.git diff --git a/src/write_riemann.c b/src/write_riemann.c index b35d10ee..80569933 100644 --- a/src/write_riemann.c +++ b/src/write_riemann.c @@ -30,8 +30,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #include "utils_cache.h" #include "utils_complain.h" #include "write_riemann_threshold.h" @@ -392,6 +392,23 @@ wrr_value_to_event(struct riemann_host const *host, /* {{{ */ RIEMANN_EVENT_FIELD_NONE); } + if (vl->meta) { + char **toc; + int n = meta_data_toc(vl->meta, &toc); + + for (int i = 0; i < n; i++) { + char *key = toc[i]; + char *value; + + if (0 == meta_data_as_string(vl->meta, key, &value)) { + riemann_event_string_attribute_add(event, key, value); + free(value); + } + } + + free(toc); + } + DEBUG("write_riemann plugin: Successfully created message for metric: " "host = \"%s\", service = \"%s\"", event->host, event->service);