Function Metrics
You can monitor the health, capacity, and performance of functions you've deployed to Oracle Functions by using metrics , alarms , and notifications.
This topic describes the metrics emitted by the metric namespace oci_faas
(the Oracle
Functions service).
Resources: functions
Overview of the Oracle Functions Service Metrics
Oracle Functions monitors function execution, and collects and reports metrics such as:
- The number of times a function is invoked.
- The length of time a function runs for.
- The number of times a function failed.
- The number of requests to invoke a function that returned a '429 Too Many Requests' error in the response (known as 'throttled function invocations').
Prerequisites
IAM policies: To monitor resources, you must be given the required type of access in a policy written by an administrator, whether you're using the Console or the REST API with an SDK, CLI, or other tool. The policy must give you access to the monitoring services as well as the resources being monitored. If you try to perform an action and get a message that you don’t have permission or are unauthorized, confirm with your administrator the type of access you've been granted and which compartment you should work in. For more information on user authorizations for monitoring, see the Authentication and Authorization section for the related service: Monitoring or Notifications.
For more information about the policy statement required to access metrics emitted by Oracle Functions, see Create a Policy to Give Oracle Functions Users Access to Function-Related Resources.
Available Metrics: oci_faas
The metrics listed in the following tables are automatically available for any functions you create. You do not need to enable monitoring on the resource to get these metrics.
Oracle Functions metrics include the following dimensions:
- APPLICATIONID
- The OCID of the application containing functions.
- RESOURCEID
- The OCID of the function.
- RESPONSETYPE
- The response when a function is invoked (one of Success, Error, or Throttled).
Metric | Metric Display Name | Unit | Description | Dimensions |
---|---|---|---|---|
FunctionExecutionDuration
|
Function Duration | ms | Total function execution duration. Expressed in milliseconds. | applicationId
|
FunctionInvocationCount
|
Function Invocations | count | Total number of function invocations. |
|
FunctionResponseCount
|
This metric is used in the following default metric charts: Errors (with Throttles (with |
count | Total number of function responses. | applicationId
|
Using the Console
- In the Console, open the navigation menu. Under Solutions and Platform, go to Developer Services and click Functions.
- Select the region you are using with Oracle Functions. Oracle recommends that you use the same region as the Docker registry that's specified in the Fn Project CLI context (see 6. Create an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure).
-
Select the compartment containing the application with functions for which you want to view metrics.
The Applications page shows all the applications in the compartment you selected.
- Click the name of the application containing the function for which you want to view metrics.
- Click the name of the function for which you want to view metrics.
-
Under Resources, click Metrics.
The Metrics page displays a chart for each metric that is emitted by the metric namespace for Oracle Functions. For more information about the emitted metrics, see Available Metrics: oci_faas.
For more information about monitoring metrics and using alarms, see Monitoring Overview. For information about notifications for alarms, see Notifications Overview.
If you don't see the metrics data for a function that you expect, see the following possible causes and resolutions.
Problem | Possible Cause | Resolution |
---|---|---|
Missing functions: A function I invoked is missing from the Invocations chart. | The chart range (time period or x-axis window) does not cover the time of invocation. | Adjust the chart range or time period as necessary. |
Gaps in metrics data: The chart line is discontinuous. I want to see data in the charts as a continuous line over time, but the line has gaps in it. | No metrics data exist in the times indicated by the gaps. | Smooth out the display by increasing the chart interval to see if gaps are removed. |
Empty charts: The Errors and Throttles charts never show data. | No metrics data exists for these charts in the specified chart range. No errors have occurred, and no requests have been throttled. Empty Errors and Throttles charts are expected. | Not applicable. |
Throttles data: The Throttles chart shows data. What should I do? | Data in the Throttles chart indicates at least one request to invoke a function returned a '429 Too Many Requests' error in the response. | Resubmit the throttled invocation requests. Submit future invocation requests less frequently. |
- In the Console, open the navigation menu. Under Solutions and Platform, go to Developer Services and click Functions.
- Select the region you are using with Oracle Functions. Oracle recommends that you use the same region as the Docker registry that's specified in the Fn Project CLI context (see 6. Create an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure).
-
Select the compartment containing the application for which you want to view function metrics.
The Applications page shows all the applications in the compartment you selected.
- Click the name of the application for which you want to view function metrics.
-
Under Resources, click Metrics.
The Metrics page displays a chart for each metric that is emitted by the metric namespace for Oracle Functions. For more information about the emitted metrics, see Available Metrics: oci_faas.
For more information about monitoring metrics and using alarms, see Monitoring Overview. For information about notifications for alarms, see Notifications Overview.
- Open the navigation menu. Under Solutions and Platform, go to Monitoring and click Service Metrics.
- Select the region you are using with Oracle Functions. Oracle recommends that you use the same region as the Docker registry that's specified in the Fn Project CLI context (see 6. Create an Fn Project CLI Context to Connect to Oracle Cloud Infrastructure).
-
Select the compartment containing the applications for which you want to view function metrics.
-
For Metric Namespace, select oci_faas.
The Service Metrics page dynamically updates the page to show charts for each metric that is emitted by the selected metric namespace. For more information about the emitted metrics, see Available Metrics: oci_faas.
For more information about monitoring metrics and using alarms, see Monitoring Overview. For information about notifications for alarms, see Notifications Overview.
Using the API
For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.
Use the following APIs for monitoring:
- Monitoring API for metrics and alarms
- Notifications API for notifications (used with alarms)