-
Notifications
You must be signed in to change notification settings - Fork 5.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
Unify http_listener error response with influxdb #4766
Conversation
The error strings need to match up with what the influxdb output expects to trigger the cases that will cause an upstream Telegraf to retry. telegraf/plugins/outputs/influxdb/http.go Lines 320 to 335 in af0ef55
|
That seems quite brittle, but good point. This depends on #4743 as the errors returned from the parser doesn't return the proper errors: # telegraf
$ curl -XPOST 'http://telegraf:8086/write' --data-binary 'cpu value='
{"error":"metric parse error: expected field at offset 10: \"cpu value=\""}
$ echo -e "cpu value=84\ncpu value=" | curl 'http://telegraf:8086/write?db=telegraf' --data-binary @-
{"error":"metric parse error: expected field at offset 23: \"cpu value=84\\ncpu value=\\n\""}
# influx
$ curl -i -XPOST 'http://influx:8086/write?db=telegraf' --data-binary 'cpu value='
{"error":"unable to parse 'cpu value=': missing field value"}
$ echo -e "cpu value=84\ncpu value=" | curl -i 'http://influx:8086/write?db=telegraf' --data-binary @-
{"error":"partial write: unable to parse 'cpu value=': missing field value dropped=0"} Should we also require a db to be set? Writing to influx at |
(cherry picked from commit 11baebd)
Resolves #4742