Update the OpenFaaS Watchdog to introduce two new endpoints:
This should check for the lock file at /tmp/.lock - use the existing behavior for this.
Vendor Prometheus go library and expose:
Add a Prometheus counter:
function_invocation{}
This counter should represent the requests/second.
Need to review Prometheus naming guidelines before approving the name
function_invocationfor the bucket. https://prometheus.io/docs/practices/naming/
Once complete - make equivalent change to the of-watchdog here:
https://github.com/openfaas-incubator/of-watchdog
I can start looking this if it is not urgent.
Adding the Prometheus client will bring the watchdog binary size to 6MB
Thanks for commenting. The current size is around 3.92MB - so adding instrumentation almost doubles the size of the binary.
@alexellis for _/health endpoint, what if .lock suppressed with suppressLock configuration? We need to return 404 in that case.
Great question.. Can you check what Kubernetes expects to fail a health-check? (liveness probe)https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#define-a-liveness-http-request
Anything greater than 200 to less than 400 is a success. Any other code indicates failure. For failed, the example uses 500 response.
Sounds good to me
Dumb question, but what is the difference betweek HEALTHCHECK Dockerfile and the /_/health endpoint ? They returns the same information. OpenFaaS cannot read the docker service HEALTHCHECK status ?
I have done this work now
Most helpful comment
I can start looking this if it is not urgent.