mirror of
https://github.com/openfaas/faas.git
synced 2025-06-19 12:36:40 +00:00
Turn off query for usage for invocations
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
@ -25,6 +25,9 @@ type ExternalServiceQuery struct {
|
|||||||
URL url.URL
|
URL url.URL
|
||||||
ProxyClient http.Client
|
ProxyClient http.Client
|
||||||
AuthInjector middleware.AuthInjector
|
AuthInjector middleware.AuthInjector
|
||||||
|
|
||||||
|
// IncludeUsage includes usage metrics in the response
|
||||||
|
IncludeUsage bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewExternalServiceQuery proxies service queries to external plugin via HTTP
|
// NewExternalServiceQuery proxies service queries to external plugin via HTTP
|
||||||
@ -49,6 +52,7 @@ func NewExternalServiceQuery(externalURL url.URL, authInjector middleware.AuthIn
|
|||||||
URL: externalURL,
|
URL: externalURL,
|
||||||
ProxyClient: proxyClient,
|
ProxyClient: proxyClient,
|
||||||
AuthInjector: authInjector,
|
AuthInjector: authInjector,
|
||||||
|
IncludeUsage: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +65,11 @@ func (s ExternalServiceQuery) GetReplicas(serviceName, serviceNamespace string)
|
|||||||
|
|
||||||
function := types.FunctionStatus{}
|
function := types.FunctionStatus{}
|
||||||
|
|
||||||
urlPath := fmt.Sprintf("%ssystem/function/%s?namespace=%s", s.URL.String(), serviceName, serviceNamespace)
|
urlPath := fmt.Sprintf("%ssystem/function/%s?namespace=%s&usage=%v",
|
||||||
|
s.URL.String(),
|
||||||
|
serviceName,
|
||||||
|
serviceNamespace,
|
||||||
|
s.IncludeUsage)
|
||||||
|
|
||||||
req, err := http.NewRequest(http.MethodGet, urlPath, nil)
|
req, err := http.NewRequest(http.MethodGet, urlPath, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -15,7 +15,9 @@ type HandlerSet struct {
|
|||||||
|
|
||||||
// ListFunctions lists all deployed functions in a namespace
|
// ListFunctions lists all deployed functions in a namespace
|
||||||
ListFunctions http.HandlerFunc
|
ListFunctions http.HandlerFunc
|
||||||
Alert http.HandlerFunc
|
|
||||||
|
// Alert handles alerts triggered from AlertManager
|
||||||
|
Alert http.HandlerFunc
|
||||||
|
|
||||||
// UpdateFunction updates an existing function
|
// UpdateFunction updates an existing function
|
||||||
UpdateFunction http.HandlerFunc
|
UpdateFunction http.HandlerFunc
|
||||||
|
Reference in New Issue
Block a user