diff options
Diffstat (limited to '')
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/postgres/init.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/postgres/init.go b/src/go/collectors/go.d.plugin/modules/postgres/init.go new file mode 100644 index 000000000..315a876a7 --- /dev/null +++ b/src/go/collectors/go.d.plugin/modules/postgres/init.go @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package postgres + +import ( + "errors" + + "github.com/netdata/netdata/go/go.d.plugin/pkg/matcher" +) + +func (p *Postgres) validateConfig() error { + if p.DSN == "" { + return errors.New("DSN not set") + } + return nil +} + +func (p *Postgres) initDBSelector() (matcher.Matcher, error) { + if p.DBSelector == "" { + return nil, nil + } + + return matcher.NewSimplePatternsMatcher(p.DBSelector) +} |