-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
graphite api: add support for sending metrics over UDP #546
Conversation
There already exists an API for sending metrics to InfluxDB over TCP using Graphite plaintext protocol. Sometimes it is more convenient to send metrics over UDP, so adding that support for the Graphite as well. For now at least, using the same port for UDP traffic than for TCP to make configuration really simple. UDP listener is disabled by default, but can be turned on by setting udp_enabled to true in graphite plugin configuration.
I think it would be better to have a config option to set the UDP port so you could have both running at the same time. Otherwise, looks great. |
@pauldix I can add also config option for the UDP port if that is wanted, but if you set udp_enabled = true already now, it listens to both UDP and TCP traffic. I tested by running locally and running:
Both values for "random_metric" appear in the database. |
Ah, nevermind then! If it's ok to sign a CLA we can merge this in right away http://influxdb.org/community/cla.html |
@pauldix CLA signed. |
graphite api: add support for sending metrics over UDP
Awesome, thanks @peekeri! It'll go out in the next release |
this is incorrect. statsd sends data to graphite over a tcp connection. you don't need this patch to use influxdb as a graphite backend in statsd. I actually never have encountered any agent or tool that sends data to graphite over udp. |
@Dieterbe you are absolutely correct, I made a mistake in claiming that. I mixed this with ganglia being able to forward metrics to carbon collector over UDP (if configured to do so). See https://github.com/ganglia/monitor-core/blob/master/gmetad/gmetad.conf.in and specifically carbon_protocol setting, that can be set to udp. |
There already exists an API for sending metrics to InfluxDB over TCP using
Graphite plaintext protocol. Sometimes it is more convenient to send metrics
over UDP, so adding that support for the Graphite as well. For now at least,
using the same port for UDP traffic than for TCP to make configuration really
simple.
UDP listener is disabled by default, but can be turned on by setting udp_enabled
to true in graphite plugin configuration.
There are already quite a few libraries and other solutions supporting Graphite UDP API, so this makes starting use of InfluxDB easier. One particular case where this is useful is when using StatsD as it natively supports using Graphite as the metrics backend, but it uses UDP to send metrics. This change should make InfluxDB a drop-in replacement for Graphite as StatsD backend.