Skip to content
Snippets Groups Projects
Unverified Commit 5270aa45 authored by Daniel Nelson's avatar Daniel Nelson Committed by GitHub
Browse files

Avoid loop creation in second processor pass (#3656)

parent 91fc2765
No related branches found
No related tags found
No related merge requests found
......@@ -308,7 +308,13 @@ func (a *Agent) flusher(shutdown chan struct{}, metricC chan telegraf.Metric, ag
metrics = processor.Apply(metrics...)
}
for _, m := range metrics {
outMetricC <- m
for i, o := range a.Config.Outputs {
if i == len(a.Config.Outputs)-1 {
o.AddMetric(m)
} else {
o.AddMetric(m.Copy())
}
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment