fix: check error before defer in prometheus k8s (#10091)
fix: check error before defer in prometheus k8s (#10091)


Brightspace/telegraf,nferch/telegraf,Brightspace/telegraf,influxdata/telegraf,Brightspace/telegraf,influxdata/telegraf,influxdata/telegraf,nferch/telegraf,nferch/telegraf