Ignore empty lines in Graphite plaintext (#3684)
(cherry picked from commit 87830a1c38)
This commit is contained in:
committed by
Daniel Nelson
parent
0605af7c99
commit
667940afac
@@ -138,8 +138,11 @@ func (p *GraphiteParser) Parse(buf []byte) ([]telegraf.Metric, error) {
|
||||
|
||||
// Trim the buffer, even though there should be no padding
|
||||
line := strings.TrimSpace(string(buf))
|
||||
metric, err := p.ParseLine(line)
|
||||
if line == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
metric, err := p.ParseLine(line)
|
||||
if err == nil {
|
||||
metrics = append(metrics, metric)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user