From 754253bce1f3386089e6e758caa91dd3471ff7d7 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) --- 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() }