Skip to content

Commit 90931ff

Browse files
committed
PMM-7344 Improve readme. Remove dublicate code.
1 parent 28a1c80 commit 90931ff

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localh
3434
Use the flag if you don't want to scrape `pg_settings`.
3535

3636
* `auto-discover-databases`
37-
Whether to discover the databases on a server dynamically.
37+
Enable discovering databases automatically.
3838

3939
* `extend.query-path`
4040
Path to a YAML file containing custom queries to run. Check out [`queries.yaml`](queries.yaml)
@@ -102,7 +102,7 @@ The following environment variables configure the exporter:
102102
Use the flag if you don't want to scrape `pg_settings`. Value can be `true` or `false`. Defauls is `false`.
103103

104104
* `PG_EXPORTER_AUTO_DISCOVER_DATABASES`
105-
Whether to discover the databases on a server dynamically. Value can be `true` or `false`. Defauls is `false`.
105+
Enable discovering databases automatically. Value can be `true` or `false`. Defauls is `false`.
106106

107107
* `PG_EXPORTER_EXTEND_QUERY_PATH`
108108
Path to a YAML file containing custom queries to run. Check out [`queries.yaml`](queries.yaml)

cmd/postgres_exporter/postgres_exporter.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ const (
7676
serverLabelName = "server"
7777
)
7878

79-
func init() {
80-
prometheus.MustRegister(version.NewCollector("postgres_exporter"))
81-
}
82-
8379
type MetricResolution string
8480

8581
const (
@@ -1718,14 +1714,14 @@ func main() {
17181714
exporter.servers.Close()
17191715
}()
17201716

1717+
prometheus.MustRegister(exporter)
1718+
17211719
version.Branch = Branch
17221720
version.BuildDate = BuildDate
17231721
version.Revision = Revision
17241722
version.Version = VersionShort
17251723
prometheus.MustRegister(version.NewCollector("postgres_exporter"))
17261724

1727-
prometheus.MustRegister(exporter)
1728-
17291725
psCollector := prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{})
17301726
goCollector := prometheus.NewGoCollector()
17311727

0 commit comments

Comments
 (0)