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

Ignore errors serializing metrics #5943

Merged

Conversation

danielnelson
Copy link
Contributor

When using the Serialize() function to serialize metrics one at a time, sometimes a single metric cannot be serialized. This if often because the particular Serializer does not support a feature of telegraf.Metric, in the case this PR is addressing the influx serializer does not support +Inf floats.

I considered having the serializer return nil, nil, but decided against it because this would require users to check both the error and the buffer before writing the metric. Another option would be to return a sentinel error value that could be used to ignore, I think this may be a good method but I opted to not introduce any new types at this time.

closes #5858

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson danielnelson added the fix pr to fix corresponding bug label Jun 2, 2019
@danielnelson danielnelson added this to the 1.11.0 milestone Jun 2, 2019
@danielnelson danielnelson merged commit 4197426 into influxdata:master Jun 4, 2019
@danielnelson danielnelson deleted the ignore-unserializable-error branch June 4, 2019 00:34
hwaastad pushed a commit to hwaastad/telegraf that referenced this pull request Jun 13, 2019
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

agent discards the whole batch of metrics in case of a serialization issue in a single metric
1 participant