openfaas/faasd

Instrument the provider

alexellis opened this issue · 2 comments

Why do you need this?

The provider for faasd can now be instrumented by Prometheus due to a recent change in faas-provider.
The new metrics are described in the following PR: openfaas/faas-provider#64 / release: https://github.com/openfaas/faas-provider/releases/tag/v0.19.0

This will give users more visibility into bottlenecks, performance issues, or issues caused by poor integration or 3rd party automation code.

This is how the change was implemented in faas-netes, however for faasd, the rule should be much simpler.

The only challenge is that the gateway runs as a container, inside the same network as Prometheus, where as the provider runs on the host as a Go process. So we may need to use the IP of the CNI bridge from the Prometheus config file to address the provider endpoint.

openfaas/faas-netes#978

The only challenge is that the gateway runs as a container, inside the same network as Prometheus, where as the provider runs on the host as a Go process. So we may need to use the IP of the CNI bridge from the Prometheus config file to address the provider endpoint.

Won't it be possible by just providing

  - job_name: 'provider'
    static_configs:
    - targets: ['localhost:8080']

Also, as we would have to introduce /mertics endpoint, so we may have to copy relevant vendor files too.

I think you will need ip addr ifconfig openfaas0 and to use the IP there.

  1. Update go.mod to bring in the new provider version
  2. Build, deploy and restart faasd/faasd-provider
  3. Check with curl to the provider port
  4. Update Prometheus config with a new scrape URL and restart faasd
  5. Check Prometheus UI