Description: Swap to prometheus/client_golang version.NewCollector function.
 prometheus/common dropped support for its version.NewCollector function:
 https://github.com/prometheus/common/commit/6aadcf4fef4168593e8c054fe0f6d65d35600c21
 Use the function provided by prometheus/client_golang instead.
Author: Lena Voytek <lena@voytek.dev>
Forwarded: no
Last-Update: 2024-03-29
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/pgbouncer_exporter.go
+++ b/pgbouncer_exporter.go
@@ -20,6 +20,7 @@
 	"github.com/go-kit/log/level"
 	"github.com/prometheus/client_golang/prometheus"
 	"github.com/prometheus/client_golang/prometheus/collectors"
+	versioncollector "github.com/prometheus/client_golang/prometheus/collectors/version"
 	"github.com/prometheus/client_golang/prometheus/promhttp"
 	"github.com/prometheus/common/promlog"
 	"github.com/prometheus/common/promlog/flag"
@@ -61,7 +62,7 @@
 	connectionString := *connectionStringPointer
 	exporter := NewExporter(connectionString, namespace, logger)
 	prometheus.MustRegister(exporter)
-	prometheus.MustRegister(version.NewCollector("pgbouncer_exporter"))
+	prometheus.MustRegister(versioncollector.NewCollector("pgbouncer_exporter"))
 
 	level.Info(logger).Log("msg", "Starting pgbouncer_exporter", "version", version.Info())
 	level.Info(logger).Log("msg", "Build context", "build_context", version.BuildContext())
