From 6c16afd5fcde8a07def9ebbfdc9e2203a5766e0d Mon Sep 17 00:00:00 2001 From: Greg <2653109+glinton@users.noreply.github.com> Date: Fri, 14 Dec 2018 15:34:05 -0700 Subject: [PATCH] Run stop logic only if required in prometheus input (#5144) (cherry picked from commit 891eff09303ac9ed6e9ddda86105fab2f9ce892e) --- plugins/inputs/prometheus/prometheus.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/inputs/prometheus/prometheus.go b/plugins/inputs/prometheus/prometheus.go index 84fc31800d53c..eaadf14523650 100644 --- a/plugins/inputs/prometheus/prometheus.go +++ b/plugins/inputs/prometheus/prometheus.go @@ -305,7 +305,9 @@ func (p *Prometheus) Start(a telegraf.Accumulator) error { } func (p *Prometheus) Stop() { - p.cancel() + if p.MonitorPods { + p.cancel() + } p.wg.Wait() }