[collectd] write_http plugin - dynamic tag

Shirly Radco sradco at redhat.com
Tue Nov 1 20:45:59 CET 2016


Thank you Marc!

It is very good to know that.

I was trying to get the tag dynamic because I'm also using Fluentd and
there I want to treat each metric differently.

The tag after the url in the write_http is used in Fluenyd to match the
record and in order to make transformations on.

I managed to manipulate the tag to what I needed finally. But it will be
much better if it could be done in collectd.conf in the first place.

Thanks again
Shirly

On Nov 1, 2016 6:55 PM, "Marc Fournier" <marc.fournier at camptocamp.com>
wrote:

>
> Not sure if this answers your question, but starting with 5.6, the
> following config should allow you to add arbitry key-values to outgoing
> metrics:
>
> <Plugin write_http>
>   <Node "example">
>     URL "http://localhost:4567/collectd-post"
>     Format "json"
>   </Node>
> </Plugin>
>
> PostCacheChain "PostCache"
> <Chain "PostCache">
>   <Rule "test">
>     <Match "regex">
>       Plugin "^cpu$"
>     </Match>
>     <Target "set">
>       MetaData "foo" "bar"
>     </Target>
>   </Rule>
>   Target "write"
> </Chain>
>
> Running with the config above, values such as this get POSTed by
> collectd's write_http plugin:
>
> {"values":[136247],"dstypes":["derive"],"dsnames":["value"],
> "time":1478019107.077,"interval":1.000,"host":"localhost","plugin":"cpu","
> plugin_instance":"2","type":"cpu","type_instance":"idle","
> meta":{"foo":"bar"}},
>
> HTH,
> Marc
>
> Shirly Radco <sradco at redhat.com> writes:
>
> > Would really appreciate if you can elaborate how...
> >
> > Thank you in advance,
> >
> > Shirly Radco
> >
> > BI Software Engineer
> > Red Hat Israel Ltd.
> > 34 Jerusalem Road
> > Building A, 4th floor
> > Ra'anana, Israel 4350109
> >
> >
> > On Thu, Oct 13, 2016 at 1:36 PM, Aurelien ROUGEMONT <beorn at binaries.fr>
> > wrote:
> >
> >> On 10/13/2016 12:29 PM, Shirly Radco wrote:
> >> > Hi,
> >> >
> >> > Is there an option to dynamically generate the tag in the collectd
> >> > write_http plugin?
> >> > (Use the record values to add as tag)
> >> >
> >> > Thank you,
> >> >
> >> > Shirly Radco
> >> >
> >> > BI Software Engineer Red Hat Israel Ltd. 34 Jerusalem Road Building A,
> >> > 4th floor Ra'anana, Israel 4350109
> >> >
> >> >
> >> >
> >> > _______________________________________________
> >> > collectd mailing list
> >> > collectd at verplant.org
> >> > https://mailman.verplant.org/listinfo/collectd
> >> >
> >> Hello Shirly,
> >>
> >> I've done just that in the kairosdb format for write_http
> >>
> >> Aurelien
> >>
> >> --
> >> Aurelien ROUGEMONT
> >> beorn at binaries.fr
> >>
> >>
> >> _______________________________________________
> >> collectd mailing list
> >> collectd at verplant.org
> >> https://mailman.verplant.org/listinfo/collectd
> >>
> > _______________________________________________
> > collectd mailing list
> > collectd at verplant.org
> > https://mailman.verplant.org/listinfo/collectd
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20161101/6b25ff2d/attachment.html>


More information about the collectd mailing list