influxdata/telegraf

Define an error handling behavior of Serializer.SerializeBatch function

Open

#8.830 aberto em 8 de fev. de 2021

Ver no GitHub
 (2 comments) (0 reactions) (0 assignees)Go (4.161 forks)batch import
feature requesthelp wantedsize/l

Métricas do repositório

Stars
 (9.892 stars)
Métricas de merge de PR
 (Mesclagem média 2d 12h) (136 fundiu PRs em 30d)

Description

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.

Guia do colaborador