Skip to content

Commit 588acf1

Browse files
committed
Ensure collector closes
1 parent 9003221 commit 588acf1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cmd/postgres_exporter/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ func main() {
142142
if err != nil {
143143
level.Warn(logger).Log("msg", "Failed to create PostgresCollector", "err", err.Error())
144144
} else {
145+
defer pe.Close()
145146
prometheus.MustRegister(pe)
146147
}
147148

0 commit comments

Comments
 (0)