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

Improve error strings from line protocol parser #4743

Closed
danielnelson opened this issue Sep 25, 2018 · 0 comments · Fixed by #5484
Closed

Improve error strings from line protocol parser #4743

danielnelson opened this issue Sep 25, 2018 · 0 comments · Fixed by #5484
Assignees
Labels
feature request Requests for new plugin and for new features to existing plugins
Milestone

Comments

@danielnelson
Copy link
Contributor

Feature Request

When sending batches of line protocol it is very difficult to parse the error messages because the entire batch is shown.

Proposal:

Show only a section of the offending line and show the line number and column.

$ cat test
cpu,cpu=cpu0 usage_guest=0,usage_guest_nice=0,usage_idle=0,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=4.00,usage_steal=0,usage_system=96.00,usage_user=0 1537833474000000000 cpu,cpu=cpu0 usage_guest=0,usage_guest_nice=0,usage_idle=0,usage_iowait=0,usage_irq=0,usage_nice=invalid,usage_softirq=4.00,usage_steal=0,usage_system=96.00,usage_user=0 1537833474000000000
$ curl -v 'http://localhost:9999/write?db=telegraf' --data-binary @test

Current behavior:

Only byte offset is given

metric parse error: expected field at offset 281: "cpu,cpu=cpu0 usage_guest=0,usage_guest_nice=0,usage_idle=0,usage_iowait=0,usage_irq=0,usage_nice=0,usage_softirq=4.00,usage_steal=0,usage_system=96.00,usage_user=0 1537833474000000000\ncpu,cpu=cpu0 usage_guest=0,usage_guest_nice=0,usage_idle=0,usage_iowait=0,usage_irq=0,usage_nice=invalid,usage_softirq=4.00,usage_steal=0,usage_system=96.00,usage_user=0 1537833474000000000\n\n"

Desired behavior:

The error message contains line/column instead of offset. Column is given as a codepoint(rune) offset.

metric parse error: expected field on line: 2, column: 98: "cpu,cpu=cpu0 usage_guest=0,usage_guest_nice=0,usage_idle=0,usage_iowait=0,usage_irq=0,usage_nice=invalid,usage_softirq=4.00,usage_steal=0,usage_system=96.00,usage_user=0 1537833474000000000"

Use case:

Impossible to find cause of error with current format and common batch sizes.

@danielnelson danielnelson added the feature request Requests for new plugin and for new features to existing plugins label Sep 25, 2018
@glinton glinton added this to the 1.8.1 milestone Sep 27, 2018
@glinton glinton self-assigned this Sep 27, 2018
@danielnelson danielnelson modified the milestones: 1.8.1, 1.9.0 Oct 1, 2018
@danielnelson danielnelson modified the milestones: 1.9.0, 1.10.0 Nov 3, 2018
@russorat russorat assigned danielnelson and unassigned glinton Nov 19, 2018
@danielnelson danielnelson mentioned this issue Feb 26, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants