Function Metrics

Find out about the metrics emitted by OCI Functions in the oci_faas metric namespace.

You can monitor the health, capacity, and performance of functions you've deployed to OCI Functions by using metrics , alarms , and notifications.

This topic describes the metrics emitted by the metric namespace oci_faas (the OCI Functions service).

Resources: functions

Overview of the OCI Functions Service Metrics

OCI 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 requests to invoke a function that failed with an error response (including the error code and error message).
  • The number of requests to invoke a function that returned a '429 Too Many Requests' error in the response (known as 'throttled function invocations').
  • The amount of memory that is allocated for concurrent function execution and for provisioned concurrency (see Monitoring Memory Usage and Availability for OCI Functions).

While frequency varies by metric, default service metrics typically have a frequency of 60 seconds (that is, at least one data point posted per minute).

Prerequisites

IAM policies: To monitor resources, you must be granted 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, contact the administrator to find out what type of access you were granted and which compartment  you need to work in. For more information about user authorizations for monitoring, see IAM Policies.

For more information about the policy statement required to access metrics emitted by OCI Functions, see Policy Statements to Give OCI 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.

OCI Functions metrics include the following dimensions:

APPLICATIONID
The OCID  of the application containing functions.
APPLIATIONSHAPE
The architecture of the application.
COMPARTMENTID
The OCID  of the compartment containing the application.
RESOURCEID
The OCID  of the function.
RESOURCENAME
The name of the application containing the function, and the name of the function.
RESPONSETYPE
The response when a function is invoked (one of Success, Error, or Throttled).
USERTENANCYID
The OCID  of the tenancy that invoked the function.
Metric Metric Display Name Unit Description Dimensions
AllocatedProvisionedConcurrency Functions Allocated Provisioned Concurrency megabytes Memory consumed by provisioned concurrency slots. applicationId

compartmentId

resourceId

resourceName

AllocatedTotalConcurrency Functions Allocated Concurrency megabytes Total concurrent memory allocated. applicationShape

compartmentId

resourceId

resourceName

FunctionExecutionDuration Function Duration ms Total function execution duration. Expressed in milliseconds. applicationId

resourceId

userTenancyId

FunctionInvocationCount Function Invocations count Total number of function invocations. applicationId

resourceId

userTenancyId

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

userTenancyId

responseType

Additionally, when responseType = "Error", the following dimensions are available for individual functions:

ErrorCode

ErrorMessage

Using the Console

To view default metric charts for a single function
  1. Open the navigation menu and click Developer Services. Under Functions, click Applications.
  2. Select the region you're using with OCI Functions.

    We recommend that you use the same region as the Docker registry that's specified in the Fn Project CLI context. See Creating 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 OCI Functions. For more information about the emitted metrics, see Available Metrics: oci_faas.

    For more information about monitoring metrics and using alarms, see Overview of Monitoring. For information about notifications for alarms, see Overview of Notifications.

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. Open the navigation menu and click Developer Services. Under Functions, click Applications.
  2. Select the region you're using with OCI Functions.

    We recommend that you use the same region as the Docker registry that's specified in the Fn Project CLI context. See Creating 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 OCI Functions. For more information about the emitted metrics, see Available Metrics: oci_faas.

For more information about monitoring metrics and using alarms, see Overview of Monitoring. For information about notifications for alarms, see Overview of Notifications.

To view default metric charts for all the functions in all the applications in a compartment
  1. Open the navigation menu and click Observability & Management. Under Monitoring, click Service Metrics.
  2. Select the region you're using with OCI Functions.

    We recommend that you use the same region as the Docker registry that's specified in the Fn Project CLI context. See Creating 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 Overview of Monitoring. For information about notifications for alarms, see Overview of Notifications.