Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Make sure all collectors have loggers #878

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions collector/pg_postmaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"context"
"database/sql"

"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand All @@ -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 (
Expand Down
6 changes: 4 additions & 2 deletions collector/pg_replication.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package collector
import (
"context"

"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand All @@ -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 (
Expand Down
6 changes: 4 additions & 2 deletions collector/pg_stat_bgwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"context"
"database/sql"

"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand All @@ -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 (
Expand Down
4 changes: 3 additions & 1 deletion collector/pg_wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package collector
import (
"context"

"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"
)

Expand All @@ -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 (
Expand Down