influxdata/telegraf

Define an error handling behavior of Serializer.SerializeBatch function

Open

#8,830 创建于 2021年2月8日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)Go (4,161 fork)batch import
feature requesthelp wantedsize/l

仓库指标

Star
 (9,892 star)
PR 合并指标
 (平均合并 2天 12小时) (30 天内合并 136 个 PR)

描述

Feature Request

Currently, the serializer interface doesn't define error handling behavior of SerializeBatch function.

If an error is occurred in the middle of processing multiple metrics, whether of not return the rest of succeeded metrics is up to the implementation.

Proposal:

Define the expected behaviour and add it in the comment/document.

Current behavior:

Undefined.

It made each serializer uses different strategy.

For example,

Desired behavior:

Having well defined set of behavior including

  • Whether of not stop processing all the metrics if error occurs from one of the metrics
  • Whether of not log the error if we ignore the error
    • Maybe we can change the return error type to []error
  • Possibly having a config flag for changing the behavior

Use case:

This is important to reduce possible confusions of end users and plugin writers.

贡献者指南