diff --git a/lib/promscrape/discovery/openstack/api.go b/lib/promscrape/discovery/openstack/api.go index c8b8eb228..40aa06ab9 100644 --- a/lib/promscrape/discovery/openstack/api.go +++ b/lib/promscrape/discovery/openstack/api.go @@ -33,7 +33,7 @@ type apiConfig struct { // tokenLock guards creds refresh tokenLock sync.Mutex creds *apiCredentials - // authTokenReq contins request body for apiCredentials + // authTokenReq contains request body for apiCredentials authTokenReq []byte // keystone endpoint endpoint *url.URL diff --git a/lib/promscrape/discovery/openstack/instance.go b/lib/promscrape/discovery/openstack/instance.go index e9c852b31..0d020b6a0 100644 --- a/lib/promscrape/discovery/openstack/instance.go +++ b/lib/promscrape/discovery/openstack/instance.go @@ -5,6 +5,7 @@ import ( "fmt" "path" "sort" + "strconv" "github.com/VictoriaMetrics/VictoriaMetrics/lib/promscrape/discoveryutils" ) @@ -110,12 +111,9 @@ func (cfg *apiConfig) getServers() ([]server, error) { } computeURL := *creds.computeURL computeURL.Path = path.Join(computeURL.Path, "servers", "detail") - // by default, query fetches data from all tenants - if !cfg.allTenants { - q := computeURL.Query() - q.Set("all_tenants", "false") - computeURL.RawQuery = q.Encode() - } + q := computeURL.Query() + q.Set("all_tenants", strconv.FormatBool(cfg.allTenants)) + computeURL.RawQuery = q.Encode() nextLink := computeURL.String() var servers []server for {