Skip to content

Commit 18bf376

Browse files
authored
Merge pull request #159 from rsommer/add_cli_env_vars
Allow connection config via environment variable
2 parents 480a6a2 + 461c186 commit 18bf376

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: pgbouncer_exporter.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func main() {
4646
flag.AddFlags(kingpin.CommandLine, promlogConfig)
4747

4848
var (
49-
connectionStringPointer = kingpin.Flag("pgBouncer.connectionString", "Connection string for accessing pgBouncer.").Default("postgres://postgres:@localhost:6543/pgbouncer?sslmode=disable").String()
49+
connectionStringPointer = kingpin.Flag("pgBouncer.connectionString", "Connection string for accessing pgBouncer.").Default("postgres://postgres:@localhost:6543/pgbouncer?sslmode=disable").Envar("PGBOUNCER_EXPORTER_CONNECTION_STRING").String()
5050
metricsPath = kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()
5151
pidFilePath = kingpin.Flag("pgBouncer.pid-file", pidFileHelpText).Default("").String()
5252
)

0 commit comments

Comments
 (0)