diff --git a/lib/promscrape/discovery/dockerswarm/nodes.go b/lib/promscrape/discovery/dockerswarm/nodes.go index e3c85be2f..1ce99281c 100644 --- a/lib/promscrape/discovery/dockerswarm/nodes.go +++ b/lib/promscrape/discovery/dockerswarm/nodes.go @@ -47,10 +47,9 @@ func getNodesLabels(cfg *apiConfig) ([]map[string]string, error) { func getNodes(cfg *apiConfig) ([]node, error) { filtersQueryArg := "" - if cfg.role == roleNodes { + if cfg.role == "nodes" { filtersQueryArg = cfg.filtersQueryArg } - resp, err := cfg.getAPIResponse("/nodes", filtersQueryArg) if err != nil { return nil, fmt.Errorf("cannot query dockerswarm api for nodes: %w", err) diff --git a/lib/promscrape/discovery/dockerswarm/services.go b/lib/promscrape/discovery/dockerswarm/services.go index 56d2a504e..d7562202a 100644 --- a/lib/promscrape/discovery/dockerswarm/services.go +++ b/lib/promscrape/discovery/dockerswarm/services.go @@ -60,10 +60,9 @@ func getServicesLabels(cfg *apiConfig) ([]map[string]string, error) { func getServices(cfg *apiConfig) ([]service, error) { filtersQueryArg := "" - if cfg.role == roleServices { + if cfg.role == "services" { filtersQueryArg = cfg.filtersQueryArg } - data, err := cfg.getAPIResponse("/services", filtersQueryArg) if err != nil { return nil, fmt.Errorf("cannot query dockerswarm api for services: %w", err) diff --git a/lib/promscrape/discovery/dockerswarm/tasks.go b/lib/promscrape/discovery/dockerswarm/tasks.go index 01ad64cd0..ddd0d5a0b 100644 --- a/lib/promscrape/discovery/dockerswarm/tasks.go +++ b/lib/promscrape/discovery/dockerswarm/tasks.go @@ -62,10 +62,9 @@ func getTasksLabels(cfg *apiConfig) ([]map[string]string, error) { func getTasks(cfg *apiConfig) ([]task, error) { filtersQueryArg := "" - if cfg.role == roleTasks { + if cfg.role == "tasks" { filtersQueryArg = cfg.filtersQueryArg } - resp, err := cfg.getAPIResponse("/tasks", filtersQueryArg) if err != nil { return nil, fmt.Errorf("cannot query dockerswarm api for tasks: %w", err)