diff --git a/lib/promscrape/discovery/dockerswarm/nodes.go b/lib/promscrape/discovery/dockerswarm/nodes.go index daafd71c7..1e3ea0801 100644 --- a/lib/promscrape/discovery/dockerswarm/nodes.go +++ b/lib/promscrape/discovery/dockerswarm/nodes.go @@ -48,10 +48,9 @@ func getNodesLabels(cfg *apiConfig) ([]*promutils.Labels, 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 7b09d4365..725ceb0f4 100644 --- a/lib/promscrape/discovery/dockerswarm/services.go +++ b/lib/promscrape/discovery/dockerswarm/services.go @@ -60,10 +60,9 @@ func getServicesLabels(cfg *apiConfig) ([]*promutils.Labels, 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 f0e0d9438..d9d25a924 100644 --- a/lib/promscrape/discovery/dockerswarm/tasks.go +++ b/lib/promscrape/discovery/dockerswarm/tasks.go @@ -63,10 +63,9 @@ func getTasksLabels(cfg *apiConfig) ([]*promutils.Labels, 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)