API management enables you to swiftly configure throttling and alerts for APIs within your service projects. This topic outlines the steps for setting up these configurations.
Limits
The high availability module of DataService Studio, when activated, ensures that throttling rules only impact the primary link, leaving the backup link unaffected.
APIs in the development environment are not equipped for alert configuration.
Permission description
Super administrators, project administrators, and operations and maintenance personnel have the authority to configure throttling and alerts for APIs.
Throttling settings
Navigate to Service > O&M from the top menu bar on the Dataphin home page.
In the left-side navigation pane, select API O&M. On the API O&M page, click Throttling in the Actions column for the desired API.
In the API Throttling Configuration dialog box, set the necessary parameters.
Parameter
Description
Throttling status
Select the throttling status.
Time unit
Select the time unit for throttling. Currently, only sec is supported.
Time unit
Select the time unit for throttling. The system provides the following time units: sec, min, hour, and day.
API traffic limit
Enter the throttling limit for the API. For example, if the total traffic purchased by the enterprise is 500 queries per second and time unit is set to sec, the value of API traffic limit must be less than or equal to 500.
App traffic limit
Enter the traffic control for downstream apps of the API. The rules for App traffic limit are as follows:
The App traffic limit applies to all apps under the API.
The App traffic limit must be less than or equal to the API traffic limit.
The priority of the API traffic limit is higher than that of the App traffic limit. For example, if the API traffic limit is 1,000 queries per second, App1 has a traffic limit of 500 queries per second, App2 has a traffic limit of 500 queries per second, and App3 has a traffic limit of 500 queries per second, the total traffic limit of all apps exceeds the API traffic limit. However, the upper limit of traffic is the API traffic limit.
If the App traffic limit exceeds the API traffic limit, the system returns an error message.
Add App
Click Add App to configure Application and Throttling count. The rules for Throttling count are as follows:
The Throttling count for a specific app must be less than or equal to the API traffic limit.
If the Throttling count for a specific app exceeds the API traffic limit, the system returns an error message.
Confirm the settings by clicking OK.
Should the request rate exceed the set limit within a specified time window, the system will initiate protective measures such as queuing, waiting, or degradation.
Alert settings
On the API O&M page, click Alerts in the Actions column for the target API.
Configure the alert information for the API on the API Alerts page.
Parameter
Description
Monitoring metric
Select the monitoring metric for the alert rule. The Monitoring metrics include the following:
Number of calls: The total number of API calls within a time unit.
Error rate: The total number of API call errors divided by the total number of API calls within a time unit.
Average response time: The total response time of API calls divided by the total number of API calls within a time unit.
Time unit
Select the time unit for API calls. The Time units include 1min, 5min, 10min, 30min, and 60min.
Operator
Select the operator to compare the monitoring metric with the Trigger threshold. The Operators include =, >=, <=, <, >, and !=.
Trigger threshold
Enter the trigger threshold for the alert rule.
Notification method
Select the method to notify alert information.
Notification recipient
Select the recipient of the alert information.
Silence period
To avoid repeated alerts within a short period, you can set a silence period. During the silence period, the system does not resend the same alert rule information.
Status
Supports On or Off.
Finalize the alert configuration by clicking OK.
When an application invokes the API and a monitoring alert rule is triggered, the system dispatches an alert message to facilitate prompt identification and resolution of any issues.