Skip to content
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

Problems using UDP influxdb output #2862

Closed
mcfedr opened this issue May 29, 2017 · 6 comments · Fixed by #2869
Closed

Problems using UDP influxdb output #2862

mcfedr opened this issue May 29, 2017 · 6 comments · Fixed by #2869
Assignees
Labels
bug unexpected problem or unintended behavior regression something that used to work, but is now broken
Milestone

Comments

@mcfedr
Copy link
Contributor

mcfedr commented May 29, 2017

Looks like telegraf is splitting a udp message and this means its not getter parsed properly by influxdb.

This has started happening since update to telegraf 1.3

Relevant telegraf.conf:

[[outputs.influxdb]]
  urls = ["udp://influxdb:8089"]
  database = "telegraf"
  retention_policy = ""
  write_consistency = "any"
  timeout = "5s

[[inputs.system]]

System info:

Telegraf 1.3 docker image
Influxdb 1.2 docker image

Log message

influxdb_1    | [I] 2017-05-29T09:25:00Z Failed to parse points: unable to parse 'system,host=proxy-docker uptime_format="5 days 1496049900000000000': unbalanced quotes service=udp
influxdb_1    | [I] 2017-05-29T09:25:00Z Failed to parse points: unable to parse 'system,host=proxy-docker   1:26" 1496049900000000000': invalid field format service=udp
@oplehto
Copy link
Contributor

oplehto commented May 29, 2017

I am seeing something which may be related with the socket writer plugin with UDP: Unrelated metrics are getting randomly dropped when there are measurements active which require a split into multiple UDP packets. The amount of drops seems to correlate with the amount of splits required.

I haven't had time to look in any deeper but I suspect that this loop breaks prematurely:

func (c *udpClient) WriteStream(r io.Reader, contentLength int) (int, error) {

@sebito91
Copy link
Contributor

sebito91 commented May 29, 2017

The splitter was updated before the v1.3.0 release here: #2795. The splits actually take place in the influxdb Write function (the conn in the udp.go file).

Split function -- https://github.com/influxdata/telegraf/blob/master/metric/metric.go#L220

@danielnelson danielnelson added bug unexpected problem or unintended behavior regression something that used to work, but is now broken labels May 30, 2017
@danielnelson danielnelson added this to the 1.3.1 milestone May 30, 2017
@danielnelson
Copy link
Contributor

I think maybe we shouldn't determine the buffer length until after splitting https://github.com/influxdata/telegraf/blob/master/plugins/outputs/influxdb/influxdb.go#L189

@sebito91
Copy link
Contributor

I see what happened, it was refactored slightly on #2799 since we merged #2795! @danielnelson, didn't realize we actually merged that...I think we built with just #2795 but will confirm in the morning.

@danielnelson
Copy link
Contributor

I'm pretty sure this is it, working on PR now.

@danielnelson
Copy link
Contributor

The invalid points was fixed in 1.3.1, but there was still an edge case where long point are not split correctly and they would be dropped. This is fixed in 1.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior regression something that used to work, but is now broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants