Skip to content
Snippets Groups Projects
Commit feb649be authored by Alex Ellis (OpenFaaS Ltd)'s avatar Alex Ellis (OpenFaaS Ltd)
Browse files

Turn off query for usage for invocations

parent d85d5e72
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,9 @@ type ExternalServiceQuery struct {
URL url.URL
ProxyClient http.Client
AuthInjector middleware.AuthInjector
// IncludeUsage includes usage metrics in the response
IncludeUsage bool
}
// NewExternalServiceQuery proxies service queries to external plugin via HTTP
......@@ -49,6 +52,7 @@ func NewExternalServiceQuery(externalURL url.URL, authInjector middleware.AuthIn
URL: externalURL,
ProxyClient: proxyClient,
AuthInjector: authInjector,
IncludeUsage: false,
}
}
......@@ -61,7 +65,11 @@ func (s ExternalServiceQuery) GetReplicas(serviceName, serviceNamespace string)
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)
if err != nil {
......
......@@ -15,7 +15,9 @@ type HandlerSet struct {
// ListFunctions lists all deployed functions in a namespace
ListFunctions http.HandlerFunc
Alert http.HandlerFunc
// Alert handles alerts triggered from AlertManager
Alert http.HandlerFunc
// UpdateFunction updates an existing function
UpdateFunction http.HandlerFunc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment