telegraf icon indicating copy to clipboard operation
telegraf copied to clipboard

StatsD output

Open gunnaraasen opened this issue 9 years ago • 14 comments

Following up with the corollary to https://github.com/influxdb/telegraf/issues/39, a StatsD output could be useful for sending metrics produced by Telegraf to a StatsD consumer.

gunnaraasen avatar Nov 05 '15 22:11 gunnaraasen

:+1:

anarcher avatar Nov 16 '15 02:11 anarcher

:+1:

pcheliniy avatar Nov 16 '15 03:11 pcheliniy

Does anyone have a suggestion on how this would work? How could a Telegraf metric be converted into a Gauge/Counter/Timer/Set?

sparrc avatar Nov 16 '15 04:11 sparrc

closing this as won't implement, there isn't a clear mapping to statsd metrics from telegraf, and there is already a PR up for graphite output #494

sparrc avatar Jan 15 '16 04:01 sparrc

Pardon my naivete, but the fact that a datadog output plugin exists indicates to me that the mapping to statsd (or datadogs variant of the statsd protocol) should be possible. What am I missing?

amoghe avatar Feb 19 '18 03:02 amoghe

Also, it looks like support for Counter and Gauge types was added in telegraf.ValueType. Maybe we could just support those two?

amoghe avatar Feb 19 '18 20:02 amoghe

After some experimenting, it looks like reusing the socket_writer (udp) with a custom serializer seems to suffice. So it seems like we don't necessarily need a new output plugin, but a serializer that can by used by a socket_writer.

@sparrc , would something like this be acceptable? Is this even on the right track?

amoghe avatar Feb 19 '18 20:02 amoghe

@amoghe Did you end up building something for this? I've been looking for a similar solution. I like telegraf's filtering capabilities, so wanted to use it to receive statsd locally and forward the filtered metrics on to another statsd-compatible agent (or multiple agents for that matter).

stevenscg avatar Apr 15 '18 13:04 stevenscg

@stevenscg not yet. I'll try to put up something this week.

amoghe avatar Apr 15 '18 19:04 amoghe

@amoghe Sounds good. I won't be much help with the coding, but happy to test it out.

stevenscg avatar Apr 15 '18 20:04 stevenscg

Did anything more happen with this? I too am interested in the results. I have a statsd-compatible upstream service and would like to aggregate custom Telegraf stats there, without having to jury-rig something with statsd itself.

OldhamMade avatar Apr 15 '20 12:04 OldhamMade

I can reopen this issue, however I have some concerns about how well this will work in practice. Telegraf doesn't currently have type information for the vast majority of metrics, the current type info does little more than support prometheus input to prometheus output roundtripping. Unless we add richer type information it will be difficult to properly set the statsd types.

danielnelson avatar Apr 15 '20 18:04 danielnelson

I am working on sending telegraf metrics to dogstatsD agent, what plugin can I use for this

imalearner96 avatar Jun 28 '22 21:06 imalearner96

Also interested in this use case as I am trying to "front" a plain protocol speaking service (collectd) with Telegraf accepting dogstatsd as input and would like to selectively forward some metrics stripped of tags to collectd while sending other metrics ingested elsewhere

elee avatar Dec 06 '22 23:12 elee