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.
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.
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:
- The OCID of the API gateway.
- The OCID of the API deployment.
- The route path for API calls to the back-end service.
- The HTTP methods of incoming connections accepted by the back-end service (such as GET, HEAD, POST, PUT, DELETE).
- The HTTP response status code received from the API gateway (such as 200, 201, 502, 504).
- The category of the HTTP response status code received from the API gateway (such as 2xx, 3xx, 4xx, 5xx).
- 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).
- The HTTP response status code received from the back end (such as 200, 201, 502, 504).
- 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|
||Bytes Received||Bytes||Number of bytes received by the API gateway from API clients.||
||Bytes Sent||Bytes||Number of bytes sent by the API gateway to API clients.||
||API Requests||count||Number of incoming API client requests to the API gateway.||
||API Responses||count||Number of http responses that the API gateway has sent back.||
||Backend Responses||count||Count of the HTTP responses returned by the back-end services.||
||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.||
||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.||
||Internal Latency||Seconds||Time spent internally in the API gateway to process the request.||
Using the Console
- In the Console, open the navigation menu. Under Solutions and Platform, go to Developer Services and click API Gateway.
- Select the region you are using with API Gateway.
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.
- Click the name of the API gateway 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 API Gateway. For more information about the emitted metrics, see Available Metrics: oci_apigateway.
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.|
- Open the navigation menu. Under Solutions and Platform, go to Monitoring and click Service Metrics.
- Select the region you are using with API Gateway
Select the compartment containing the API gateways for which you want to view metrics.
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.
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.