mirror of
https://github.com/prometheus-community/postgres_exporter
synced 2025-04-29 22:48:03 +00:00
PMM-12894 Cleanup
This commit is contained in:
parent
5a5b5ad515
commit
ba116e97b3
@ -123,8 +123,6 @@ func (e *Exporter) scrapeDSN(ch chan<- prometheus.Metric, dsn string) error {
|
||||
}
|
||||
defer server.Close()
|
||||
|
||||
level.Debug(logger).Log("msg", "scrapeDSN:"+dsn)
|
||||
|
||||
// Check if autoDiscoverDatabases is false, set dsn as master database (Default: false)
|
||||
if !e.autoDiscoverDatabases {
|
||||
server.master = true
|
||||
|
@ -109,7 +109,7 @@ type Filters struct {
|
||||
}
|
||||
|
||||
// makeRegistry creates a new prometheus registry with default and percona exporters.
|
||||
func makeRegistry(ctx context.Context, dsns []string, connSema *semaphore.Weighted, globlalCollectors map[string]prometheus.Collector, filters Filters) *prometheus.Registry {
|
||||
func makeRegistry(ctx context.Context, dsns []string, connSema *semaphore.Weighted, globalCollectors map[string]prometheus.Collector, filters Filters) *prometheus.Registry {
|
||||
registry := prometheus.NewRegistry()
|
||||
|
||||
excludedDatabases := strings.Split(*excludeDatabases, ",")
|
||||
@ -180,15 +180,15 @@ func makeRegistry(ctx context.Context, dsns []string, connSema *semaphore.Weight
|
||||
}
|
||||
|
||||
if filters.EnableAllCollectors || filters.EnableGoCollector {
|
||||
registry.MustRegister(globlalCollectors["standard.go"])
|
||||
registry.MustRegister(globalCollectors["standard.go"])
|
||||
}
|
||||
|
||||
if filters.EnableAllCollectors || filters.EnableProcessCollector {
|
||||
registry.MustRegister(globlalCollectors["standard.process"])
|
||||
registry.MustRegister(globalCollectors["standard.process"])
|
||||
}
|
||||
|
||||
if filters.EnableAllCollectors || filters.EnableVersionCollector {
|
||||
registry.MustRegister(globlalCollectors["version"])
|
||||
registry.MustRegister(globalCollectors["version"])
|
||||
}
|
||||
|
||||
if filters.EnableAllCollectors || filters.EnablePostgresCollector {
|
||||
|
Loading…
Reference in New Issue
Block a user