Kubeless monitoring relies on Prometheus. Each supported language runtimes are instrumented in such a way that they are automatically collecting metrics for each function invocation.
You could also use Grafana to visualize the prometheus metrics exposed by Kubeless. Example of a Grafana dashboard for Kubeless showing function call rate, function failure rate and execution duration:
Lets deploy a function that can generate some metrics. This function will fail on avegare 20% of the time – lets check if that holds true.
$ kubeless function deploy flakey-node \
--runtime nodejs6 \
--handler flakey.handler \
--from-file flakey.js
Now lets generate some traffic for this function to populate the dashboard:
$ while :
> do
> kubeless function call flakey-node --data 'test'
> done
You can now go to Grafana and navigate to the Kubeless
dashboard:
make open-grafana
Some time the built in dashboard does not load, try refreshing and if not create
a new dashboard and upload the dashboard.json
file inside this directory as
the source.
When you are done you can exit your open shells and run the following command:
$ kubeless function delete flakey-node