Skip to content

Commit

Permalink
Merge pull request #151 from rsommer/add_cli_env_vars
Browse files Browse the repository at this point in the history
Add environment variable handling
  • Loading branch information
stanhu authored Jul 26, 2024
2 parents f71932b + bafc4b7 commit 5b219e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pgbouncer_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ func main() {
flag.AddFlags(kingpin.CommandLine, promlogConfig)

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

toolkitFlags := kingpinflag.AddFlags(kingpin.CommandLine, ":9127")
Expand Down

0 comments on commit 5b219e0

Please sign in to comment.