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