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