diff --git a/prometheus_to_cloudwatch.go b/prometheus_to_cloudwatch.go index c0e85cc..c2281a9 100644 --- a/prometheus_to_cloudwatch.go +++ b/prometheus_to_cloudwatch.go @@ -173,10 +173,10 @@ func (b *Bridge) Run(ctx context.Context) { count, err := b.publishMetricsToCloudWatch(metricFamilies) if err != nil { log.Println("prometheus-to-cloudwatch: error publishing to CloudWatch:", err) - } else { - log.Println(fmt.Sprintf("prometheus-to-cloudwatch: published %d metrics to CloudWatch", count)) } + log.Println(fmt.Sprintf("prometheus-to-cloudwatch: published %d metrics to CloudWatch", count)) + case <-ctx.Done(): log.Println("prometheus-to-cloudwatch: stopping") return