Monitoring Functions
The http_request*
metrics record the latency and statistics of /system/*
routes to monitor the OpenFaaS gateway and its provider. The /async-function
route is also recorded in these metrics to observe asynchronous ingestion rate and latency.
These basic metrics can be used to track the health of your functions as well a general usage patterns. See the Prometheus documentation and for more details about the available options and query functions. Below are several queries you might want to include in a basic Grafana dashboard for observing your OpenFaaS functions
Function replica count / scaling
Return the total function replicas:
Return the total number of successful function invocations:
Function execution time
Each of the metrics generated by the Gateway are labeled with and can be filtered by the function name, For example The invocation rate for just a single function (e.g. if the function name is echo
) is given by
The classic and of-watchdog both provide Prometheus instrumentation on TCP port 8081 on the path /metrics. This is to enable the use-case of HPAv2 from the Kubernetes ecosystem.
Metric | Type | Description | Labels |
---|---|---|---|
http_request_duration_seconds | histogram | Seconds spent serving HTTP requests | , path , status |
http_requests_total | counter | The total number of HTTP requests | method , path , status |
Minimum watchdog versions
The metrics endpoint was added in the following versions and is enabled automatically.
- watchdog: 0.13.0
- of-watchdog 0.5.0