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

Errors from http_listener should match InfluxDB #4742

Closed
danielnelson opened this issue Sep 24, 2018 · 1 comment
Closed

Errors from http_listener should match InfluxDB #4742

danielnelson opened this issue Sep 24, 2018 · 1 comment
Assignees
Labels
bug unexpected problem or unintended behavior
Milestone

Comments

@danielnelson
Copy link
Contributor

Relevant telegraf.conf:

[[http_listener]]
  service_address = ":9999"

System info:

N/A

Steps to reproduce:

  1. Send malformed line protocol to http_listener
    • cpu value=
    • cpu value=42\ncpu value=

Expected behavior:

Telegraf response should have X-Influxdb-Error, while the error strings do
not need to be identical they should contain the prefixes unable to parse
and partial write:

$ echo -e "cpu value=" | curl -v 'http://localhost:8086/write?db=telegraf' --data-binary @-
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< X-Influxdb-Error: unable to parse 'cpu value=': missing field value
<
{"error":"unable to parse 'cpu value=': missing field value"}
$ echo -e "cpu value=84\ncpu value=" | curl -v 'http://localhost:8086/write?db=telegraf' --data-binary @-
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< X-Influxdb-Error: partial write: unable to parse 'cpu value=': missing field value dropped=0
<
{"error":"partial write: unable to parse 'cpu value=': missing field value dropped=0"}

Actual behavior:

$ echo -e "cpu value=" | curl -v 'http://localhost:9999/write?db=telegraf' --data-binary @-
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< X-Influxdb-Version: 1.0
<
{"error":"http: bad request"}
$ echo -e "cpu value=84\ncpu value=" | curl -v 'http://localhost:9999/write?db=telegraf' --data-binary @-
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
<
{"error":"http: bad request"}
@danielnelson danielnelson added the bug unexpected problem or unintended behavior label Sep 24, 2018
@danielnelson
Copy link
Contributor Author

Errors are also printed to the Telegraf log, these should be removed or logged only at debug level:

2018-09-24T23:36:27Z E! metric parse error: expected field at offset 23: "cpu value=84\ncpu value=\n"
2018-09-24T23:37:37Z E! metric parse error: expected field at offset 10: "cpu value=\n"

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
Projects
None yet
Development

No branches or pull requests

2 participants