diff --git a/collector/pg_postmaster.go b/collector/pg_postmaster.go index b81e4f905..9bdc13680 100644 --- a/collector/pg_postmaster.go +++ b/collector/pg_postmaster.go @@ -17,6 +17,7 @@ import ( "context" "database/sql" + "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" ) @@ -27,10 +28,11 @@ func init() { } type PGPostmasterCollector struct { + log log.Logger } -func NewPGPostmasterCollector(collectorConfig) (Collector, error) { - return &PGPostmasterCollector{}, nil +func NewPGPostmasterCollector(config collectorConfig) (Collector, error) { + return &PGPostmasterCollector{log: config.logger}, nil } var ( diff --git a/collector/pg_replication.go b/collector/pg_replication.go index 6067cc9b1..663905ce5 100644 --- a/collector/pg_replication.go +++ b/collector/pg_replication.go @@ -16,6 +16,7 @@ package collector import ( "context" + "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" ) @@ -26,10 +27,11 @@ func init() { } type PGReplicationCollector struct { + log log.Logger } -func NewPGReplicationCollector(collectorConfig) (Collector, error) { - return &PGReplicationCollector{}, nil +func NewPGReplicationCollector(config collectorConfig) (Collector, error) { + return &PGReplicationCollector{log: config.logger}, nil } var ( diff --git a/collector/pg_stat_bgwriter.go b/collector/pg_stat_bgwriter.go index ec446d58c..147e23f8c 100644 --- a/collector/pg_stat_bgwriter.go +++ b/collector/pg_stat_bgwriter.go @@ -17,6 +17,7 @@ import ( "context" "database/sql" + "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" ) @@ -27,10 +28,11 @@ func init() { } type PGStatBGWriterCollector struct { + log log.Logger } -func NewPGStatBGWriterCollector(collectorConfig) (Collector, error) { - return &PGStatBGWriterCollector{}, nil +func NewPGStatBGWriterCollector(config collectorConfig) (Collector, error) { + return &PGStatBGWriterCollector{log: config.logger}, nil } var ( diff --git a/collector/pg_wal.go b/collector/pg_wal.go index afa8fcef6..593c3e1de 100644 --- a/collector/pg_wal.go +++ b/collector/pg_wal.go @@ -16,6 +16,7 @@ package collector import ( "context" + "github.com/go-kit/log" "github.com/prometheus/client_golang/prometheus" ) @@ -26,10 +27,11 @@ func init() { } type PGWALCollector struct { + log log.Logger } func NewPGWALCollector(config collectorConfig) (Collector, error) { - return &PGWALCollector{}, nil + return &PGWALCollector{log: config.logger}, nil } var (