You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add environment variable control for most command line options.
Adds the following environment variables for overriding defaults:
* `PG_EXPORTER_WEB_LISTEN_ADDRESS`
* `PG_EXPORTER_WEB_TELEMETRY_PATH`
* `PG_EXPORTER_EXTEND_QUERY_PATH`
Closes#150.
Copy file name to clipboardExpand all lines: postgres_exporter.go
+5-5
Original file line number
Diff line number
Diff line change
@@ -32,9 +32,9 @@ import (
32
32
varVersion="0.0.1"
33
33
34
34
var (
35
-
listenAddress=kingpin.Flag("web.listen-address", "Address to listen on for web interface and telemetry.").Default(":9187").String()
36
-
metricPath=kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()
37
-
queriesPath=kingpin.Flag("extend.query-path", "Path to custom queries to run.").Default("").String()
35
+
listenAddress=kingpin.Flag("web.listen-address", "Address to listen on for web interface and telemetry.").Default(":9187").OverrideDefaultFromEnvar("PG_EXPORTER_WEB_LISTEN_ADDRESS").String()
36
+
metricPath=kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").OverrideDefaultFromEnvar("PG_EXPORTER_WEB_TELEMETRY_PATH").String()
37
+
queriesPath=kingpin.Flag("extend.query-path", "Path to custom queries to run.").Default("").OverrideDefaultFromEnvar("PG_EXPORTER_EXTEND_QUERY_PATH").String()
38
38
onlyDumpMaps=kingpin.Flag("dumpmaps", "Do not run, simply dump the maps.").Bool()
0 commit comments