10 Commits

Author SHA1 Message Date
Alex Ellis (OpenFaaS Ltd)
048a90a150 Reduce cache expiry
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>
2021-02-26 12:24:55 +00:00
Alex Ellis (OpenFaaS Ltd)
d5b98a7078 Restore the X-Call-Id for synchronous calls
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>
2021-02-10 09:47:09 +00:00
Alex Ellis (OpenFaaS Ltd)
f98213a428 Remove git commit message from binary
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>
2021-01-31 09:23:55 +00:00
Alex Ellis (OpenFaaS Ltd)
2e2250afe8 Use a placeholder commit message for development
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>
2021-01-20 12:02:15 +00:00
Alex Ellis (OpenFaaS Ltd)
4ced7cacd0 Update scaling polling interval
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>
2020-12-10 14:00:31 +00:00
Vivek Singh
c0ba41ce33 Use default namespace in metrics exporter
Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2020-11-02 10:35:57 +00:00
Vivek Singh
f7b02b47f8 Add namespace in function name for metrics
This commit adds namespace in function names while logging metrics to
prometheus, irrespective of the function is invoked with namespace suffix
or not.

This is also required to add multiple namespace support to faas-idler

https://github.com/openfaas-incubator/faas-idler/issues/37 which is part
of https://github.com/openfaas/faas-netes/issues/511

Signed-off-by: Vivek Singh <vivekkmr45@yahoo.in>
2020-11-02 10:35:57 +00:00
Alex Ellis (OpenFaaS Ltd)
18f6c720b5 Extract a caching function_query type
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>
2020-04-22 15:26:42 +01:00
Alex Ellis (OpenFaaS Ltd)
2bfca6d848 Publish to multiple topics
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>
2020-04-22 15:26:42 +01:00
Alex Ellis (OpenFaaS Ltd)
96812d2cd8 Record metrics for invocations when they start
* This experimental patch records metrics as invocations start
so that the metrics can be used to make better scale to zero
decisions in faas-idler.

Tested with Kubernetes on a single-node cluster, metrics
reported as expected. Existing metrics still report.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2020-03-12 13:51:43 +00:00