API Gateway Metrics
Find out about the metrics emitted by API Gateway.
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.
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).
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. See Building Metric Queries.
IAM policies: To monitor resources, you must have 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 have and which compartment you should work in. For more information about user authorizations for monitoring, see IAM Policies (Monitoring).
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 resource to which the metrics apply.
- The name of the resource to which the metrics apply.
- The OCID of the API deployment.
- The name 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 name of the back end (derived from the name of the back end rule) to which an API gateway routes requests.
- The type of back end to 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).
- The action taken by the response cache (one of HIT, MISS, BYPASS).
- The name of the entitlement.
- The OCID of the subscriber.
- The name of the subscriber.
- The name of a subscriber's client.
- The action taken if the maximum number of requests in the entitlement's quota's time period was exceeded.
- The OCID of the usage plan.
- The name of the usage plan.
|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.||
||Response Cache Actions||Count||The action taken by the response cache.||
||Response Cache Availability||Count||Availability of the response cache as seen by the API gateway.||
||Response Cache Latency||Milliseconds||Total time taken for connect, read, and store operations on the response cache.||
||Usage Plan Requests||Sum||Number of requests to a given entitlement. Emitted per request.||
||Subscriber Requests||Sum||Number of requests made by a subscriber. Emitted per request.||
||Subscriber Quota Proportion Used||Mean||Proportion of an entitlement's quota that has been consumed by a subscriber. Emitted per request.
||Subscriber Rate Limit Proportion Used||Mean||Proportion of an entitlement's rate limit that has been consumed by a subscriber. Emitted per request.
Using the Console
- In the Console, open the navigation menu and click Developer Services. Under API Management, click Gateways.
- 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 and click Observability & Management. Under Monitoring, 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.