diff options
Diffstat (limited to '')
-rw-r--r-- | src/go/collectors/go.d.plugin/modules/vernemq/init.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/go/collectors/go.d.plugin/modules/vernemq/init.go b/src/go/collectors/go.d.plugin/modules/vernemq/init.go new file mode 100644 index 000000000..24d077fbd --- /dev/null +++ b/src/go/collectors/go.d.plugin/modules/vernemq/init.go @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + +package vernemq + +import ( + "errors" + + "github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus" + "github.com/netdata/netdata/go/go.d.plugin/pkg/web" +) + +func (v *VerneMQ) validateConfig() error { + if v.URL == "" { + return errors.New("url is not set") + } + return nil +} + +func (v *VerneMQ) initPrometheusClient() (prometheus.Prometheus, error) { + client, err := web.NewHTTPClient(v.Client) + if err != nil { + return nil, err + } + + return prometheus.New(client, v.Request), nil +} |