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

resourceId

FunctionInvocationCount Function Invocations count Total number of function invocations.

applicationId

resourceId

FunctionResponseCount

This metric is used in the following default metric charts:

Errors (with responseType = "Error")

Throttles (with responseType = "Throttled")

count Total number of function responses. applicationId

resourceId

responseType

Using the Console

To view default metric charts for a single function
  1. In the Console, open the navigation menu. Under Solutions and Platform, go to Developer Services and click Functions.
  2. 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).
  3. 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.

  4. Click the name of the application containing the function for which you want to view metrics.
  5. Click the name of the function for which you want to view metrics.
  6. 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.

Not seeing the function metrics data you expect?

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.
To view default metric charts for all functions in an application
  1. In the Console, open the navigation menu. Under Solutions and Platform, go to Developer Services and click Functions.
  2. 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).
  3. 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.

  4. Click the name of the application for which you want to view function metrics.
  5. 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.

To view default metric charts for all the functions in all the applications in a compartment
  1. Open the navigation menu. Under Solutions and Platform, go to Monitoring and click Service Metrics.
  2. 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).
  3. Select the compartment containing the applications for which you want to view function metrics.

  4. 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.