Documentation ¶
Index ¶
- Constants
- func NewReader(metrics []telegraf.Metric, serializer *Serializer) io.Reader
- type FieldError
- type MetricError
- type Serializer
- func (s *Serializer) Init() error
- func (s *Serializer) InitFromConfig(cfg *serializers.Config) error
- func (s *Serializer) Serialize(m telegraf.Metric) ([]byte, error)
- func (s *Serializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error)
- func (s *Serializer) Write(w io.Writer, m telegraf.Metric) error
Constants ¶
View Source
const ( MaxInt64 = int64(^uint64(0) >> 1) NeedMoreSpace = "need more space" InvalidName = "invalid name" NoFields = "no serializable fields" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FieldError ¶
type FieldError struct {
// contains filtered or unexported fields
}
FieldError is an error causing a field to be unserializable.
func (FieldError) Error ¶
func (e FieldError) Error() string
type MetricError ¶
type MetricError struct {
// contains filtered or unexported fields
}
MetricError is an error causing an entire metric to be unserializable.
func (MetricError) Error ¶
func (e MetricError) Error() string
type Serializer ¶
type Serializer struct { MaxLineBytes int `toml:"influx_max_line_bytes"` SortFields bool `toml:"influx_sort_fields"` UintSupport bool `toml:"influx_uint_support"` // contains filtered or unexported fields }
Serializer is a serializer for line protocol.
func (*Serializer) Init ¶ added in v1.27.0
func (s *Serializer) Init() error
func (*Serializer) InitFromConfig ¶ added in v1.27.0
func (s *Serializer) InitFromConfig(cfg *serializers.Config) error
InitFromConfig is a compatibility function to construct the parser the old way
func (*Serializer) Serialize ¶
func (s *Serializer) Serialize(m telegraf.Metric) ([]byte, error)
Serialize writes the telegraf.Metric to a byte slice. May produce multiple lines of output if longer than maximum line length. Lines are terminated with a newline (LF) char.
func (*Serializer) SerializeBatch ¶
func (s *Serializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error)
SerializeBatch writes the slice of metrics and returns a byte slice of the results. The returned byte slice may contain multiple lines of data.
Click to show internal directories.
Click to hide internal directories.