The histogram for gateway_functions_seconds excluded the status
code that gives important information for setting up SLOs.
Fixes: #1725
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
* Add service target metric
* Add service min replicas metric
* Add scale type metric
These combined allow new auto-scaling modes and parameters
for OpenFaaS Pro customers.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The queue type now resides in the provider, so that there is
no risk of a circular reference.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This is currently being hidden and needs to be bubbled up
into the logs to show an issue with calling list functions
during a deletion in faasd.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
**What**
- Add unit test that verifies the behavior of the logging middleware in
various reponse cases
Signed-off-by: Lucas Roesler <roesler.lucas@gmail.com>
Reduce cache expiry to help support issues where a function
may be scaled down by a user, when it is still in use.
The 5s cache meant that all requests would fail until the
expiry. The 250ms setting is a 20x reduction.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This appears to have been removed inadvertently whilst
adding scale from zero logic into the gateway.
Going forward, synchronous and asynchronous calls will have a
header populated.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This appears to have broken CI at least three times now and
prevented us from shipping a release binary for a tag.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commits updates version endpoint to use ProviderInfo and VersionInfo structs from
faas-provider.GatewayInfo now uses ProviderInfo and VersionInfo structs. GatewayInfo is
left within gateway. Consumer of this endpoint should use typed struct GatewayInfo to
parse response.
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
The faas-cli throws an error because it always expects a
commit_message for the gateway version, and if it's null - it
will crash. This only affects local development.
The code in faas-cli should be changed to use a struct instead
of casting to an interface.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Polls every 100 ms instead of every 50ms for use with a new
faas-netes PR:
https://github.com/openfaas/faas-netes/pull/726
The call is much faster now, so this request should me made
at a lower frequency.
Also adds error handling for URL building in the external
service query code.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This patch changes the code which looks up service and appends
them to the Exporter's list. It previously would create an
endless list and cause a memory leak.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
* Updates AngularJS to 1.8.0
* Updates the MaterialUI theme to 1.2.1
* Fixes: #1576
Tested by running the gateway locally, with NATS, Prometheus,
and a gateway port-forwarded from a local KinD cluster.
The UI rendered and the newer files were served. Functions
could be deployed and invoked from the store and CLI.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This field doesn't appear to be used and is supplied via the
querystring which faas-netes (the only ns-enabled provider
already consumes)
Related to PR:
https://github.com/openfaas/faas-netes/pull/671
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The code was calling into the cache twice, even if the first
call was a cache hit and not a miss.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This type abstracts the function_query type and introduces an
interface for testing and substitution.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
Enables publishing to various topics according to annotations
on the functions. The function cache is moved up one level so
that it can be shared between the scale from zero code and the
queue proxy.
Unit tests added for new internal methods.
Tested e2e with arkade and the newest queue-worker and RC
gateway image with two queues and an annotation on one of the
functions of com.openfaas.queue. It worked as expected including
with multiple namespace support.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
The queue's name will be consumed by the queue worker to
publish to other topics / slow queues.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
NATS moved its primary library to: github.com/nats-io/stan.go
This commit synchronises the library in the gateway to match the
queue worker.
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>