API Gateway Metrics

You can monitor the health, capacity, and performance of API gateways and API deployments managed by the API Gateway service using metrics , alarms , and notifications.

This topic describes the metrics emitted by the API Gateway service in the oci_apigateway metric namespace.

Resources: gateways

Overview of the API Gateway Service Metrics

The API Gateway service metrics help you measure the connections to API gateways, and the quantity of data received and sent by API gateways. You can use metrics data to diagnose and troubleshoot API gateway and API deployment issues.

To view a default set of metrics charts in the Console, navigate to the API gateway you're interested in, and then click Metrics. You also can use the Monitoring service to create custom queries.

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.

Available Metrics: oci_apigateway

The metrics listed in the following tables are automatically available for any API gateways you create. You do not need to enable monitoring on the resource to get these metrics.

API Gateway metrics include the following dimensions:

RESOURCEID
The OCID  of the API gateway.
DEPLOYMENTID
The OCID  of the API deployment.
ROUTE
The route path for API calls to the back-end service.
HTTPMETHODTYPE
The HTTP methods of incoming connections accepted by the back-end service (such as GET, HEAD, POST, PUT, DELETE).
HTTPSTATUSCODE
The HTTP response status code received from the API gateway (such as 200, 201, 502, 504).
HTTPSTATUSCATEGORY
The category of the HTTP response status code received from the API gateway (such as 2xx, 3xx, 4xx, 5xx).
BACKENDTYPE
The type of back end by which an API gateway routes requests to a back-end service (such as HTTP_BACKEND, ORACLE_FUNCTIONS_BACKEND, STOCK_RESPONSE_BACKEND).
BACKENDHTTPSTATUSCODE
The HTTP response status code received from the back end (such as 200, 201, 502, 504).
BACKENDHTTPSTATUSCATEGORY
The category of the HTTP response status code received from the back end (such as 2xx, 3xx, 4xx, 5xx).
Metric Metric Display Name Unit Description Dimensions
BytesReceived Bytes Received Bytes Number of bytes received by the API gateway from front-end clients.

resourceId

deploymentId

route

httpMethodType

httpStatusCode

httpStatusCategory

backendType

BytesSent Bytes Sent Bytes Number of bytes sent by the API gateway to front-end clients. resourceId

deploymentId

route

httpMethodType

httpStatusCode

httpStatusCategory

backendType

HttpRequests API Requests count Number of incoming front-end client requests to the API gateway. resourceId

deploymentId

route

httpMethodType

backendType

HttpResponses API Responses count Number of http responses that the API gateway has sent back. resourceId

deploymentId

route

httpMethodType

httpStatusCode

httpStatusCategory

backendType

BackendHttpResponses Backend Responses count Count of the HTTP responses returned by the back-end services. resourceId

deploymentId

route

httpMethodType

httpStatusCode

httpStatusCategory

backendType

backendHttpStatusCode

backendHttpStatusCategory

Latency Gateway Latency Seconds Average time that it takes for a request to be processed and its response to be sent. This is calculated from the time the API gateway receives the first byte of an HTTP request to the time when the response send operation is completed. resourceId

deploymentId

route

httpMethodType

httpStatusCode

httpStatusCategory

backendType

IntegrationLatency Backend Latency Seconds Time between the API gateway sending a request to the back-end service and receiving a response from the back-end service. resourceId

deploymentId

route

httpMethodType

httpStatusCode

httpStatusCategory

backendType

InternalLatency Internal Latency Seconds Time spent internally in the API gateway to process the request. resourceId

deploymentId

route

httpMethodType

httpStatusCode

httpStatusCategory

Using the Console

To view default metric charts for a single API gateway
  1. In the Console, open the navigation menu. Under Solutions and Platform, go to Developer Services and click API Gateway.
  2. Select the region you are using with API Gateway.
  3. Select the compartment containing the API gateway for which you want to view metrics.

    The Gateways page shows all the API gateways in the compartment you selected.

  4. Click the name of the API gateway for which you want to view metrics.
  5. Under Resources, click Metrics.

    The Metrics page displays a chart for each metric that is emitted by the metric namespace for API Gateway. For more information about the emitted metrics, see Available Metrics: oci_apigateway.

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

Not seeing the API gateway metrics data you expect?

If you don't see the metrics data for an API gateway that you expect, see the following possible causes and resolutions.

Problem Possible Cause How to check Resolution
I called an API deployed on an API gateway but the HTTP Requests chart doesn't show the API call. You might have called the API outside the time period covered by the HTTP Requests chart. Confirm the Start Time and End Time cover the period when you called the API. Adjust the Start Time and End Time as necessary.
I called an API deployed on an API gateway but the HTTP Requests chart doesn't show the API call, even though I called the API between the Start Time and End Time. Although you called the API between the Start Time and End Time, the x-axis (window of data display) might be excluding the API call. Confirm the x-axis (window of data display) covers the period when the API was called. Adjust the x-axis (window of data display) as necessary.
I want to see data in the charts as a continuous line over time, but the line has gaps in it. This is expected behavior. If there is no metrics data to show in the selected interval, the data line is discontinuous. Increase the Interval (for example, from 1 minute to 5 minutes, or from 1 minute to 1 hour). Adjust the Interval as necessary.
To view default metric charts for all the API gateways 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 API Gateway
  3. Select the compartment containing the API gateways for which you want to view metrics.

  4. For Metric Namespace, select oci_apigateway.

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

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