Functions metrics can help you diagnose issues and understand your workloads by showing performance and usage of your Functions.
Functions metrics aggregate request data for an individual Pages project. To view your Functions metrics, select Pages > Pages Project > Functions Metrics.
There are three metrics that can help you understand the health of your Function in a given moment: requests success, error metrics and invocation statuses.
In the metrics graph you can see historical request counts broken down into total requests, successful requests and errored requests, as well as subrequests in the next tab.
- Total: All incoming requests registered by a Function. Requests blocked by or other security features will not count.
- Success: Requests that returned a Success or Client Disconnected .
- Errors: Requests that returned a Script Threw Exception, Exceeded Resources, or Internal Error
- Subrequests: Requests triggered by calling fetch from within a Function. When your Function fetches a static asset, it will count as a subrequest. A subrequest that throws an uncaught error will not be counted.
Request traffic data may display a drop off near the last few minutes displayed in the graph for time ranges less than six hours. This does not reflect a drop in traffic, but a slight delay in aggregation and metrics delivery.
Function invocation statuses indicate whether a Function executed successfully or failed to generate a response in the Workers runtime. Invocation statuses differ from HTTP status codes. In some cases, a Function invocation succeeds but does not generate a successful HTTP status because of another error encountered outside of the Workers runtime. Some invocation statuses result in a Workers error code being returned to the client.
|Invocation status||Definition||Workers error code||Graph QL field|
|Success||Worker script executed successfully||success|
|Client disconnected||HTTP client disconnected before the request completed||clientDisconnected|
|Exceeded resources^1||Worker script exceeded runtime limits||1102, 1027||exceededResources|
|Internal error^2||Workers runtime encountered an error||internalError|
- The Exceeded Resources status may appear when the Worker exceeds a . The most common cause is excessive CPU time, but is also caused by a script exceeding startup time or free tier limits.
- The Internal Error status may appear when the Workers runtime fails to process a request due to an internal failure in our system. These errors are not caused by any issue with the Function code nor any resource limit. While requests with Internal Error status are rare, some may appear during normal operation. These requests are not counted towards usage for billing purposes. If you notice an elevated rate of requests with Internal Error status, review
CPU time per execution
Duration per execution
Understanding duration on your Function is especially useful when you are intending to do a significant amount of computation on the Function itself. This is because you may have to use the Unbound usage model which allows up to 30 seconds of CPU time. The Unbound model is charged on duration, see for more info.
Functions metrics can be inspected for up to three months in the past in maximum increments of one week. The dashboard includes the charts and information described above.