Ignore errors serializing single metrics (#5943)

This commit is contained in:
Daniel Nelson
2019-06-03 17:34:48 -07:00
committed by GitHub
parent 3c83a53d51
commit 4197426a73
13 changed files with 42 additions and 28 deletions

View File

@@ -30,6 +30,9 @@ type Serializer interface {
// Serialize takes a single telegraf metric and turns it into a byte buffer.
// separate metrics should be separated by a newline, and there should be
// a newline at the end of the buffer.
//
// New plugins should use SerializeBatch instead to allow for non-line
// delimited metrics.
Serialize(metric telegraf.Metric) ([]byte, error)
// SerializeBatch takes an array of telegraf metric and serializes it into
@@ -41,7 +44,7 @@ type Serializer interface {
// Config is a struct that covers the data types needed for all serializer types,
// and can be used to instantiate _any_ of the serializers.
type Config struct {
// Dataformat can be one of: influx, graphite, or json
// Dataformat can be one of the serializer types listed in NewSerializer.
DataFormat string
// Support tags in graphite protocol