API details

更新时间:
复制 MD 格式

The API details page displays key metrics for all APIs in your application, such as passed QPS, throttled QPS, exception QPS, RT, and concurrency. You can also use this page to manage flow control rules for your APIs.

Entry point

  1. Log on to the AHAS console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose traffic protection > application protection.

  3. On the application protection page, click the target application card on the application card tab.

  4. In the left-side navigation pane, choose API details.

Features

The API details page displays detailed metrics for all APIs in the application, including QPS, RT, and concurrency.

接口详情

You can also perform the following operations on this page:

  • (Icon ①) In the upper-right corner of the page, select a display mode. The default mode is details view.
    • details view: Displays metrics such as passed QPS, throttled QPS, and RT in time-series charts and lists.
    • statistics view: Displays a list of metrics for a specific day, including metric percentages, total passed requests, and total rejected requests.
  • (Icon ②) In the upper-right corner of the page, you can select a time range to view historical data for your APIs.
    Note Historical data is retained for a maximum of 7 days.
  • (Icon ③) In the top menu bar, click tabs such as WEB or RPC to filter APIs by type.
  • (Icon ④) In the API list area, click an API name to view its time-series charts for QPS, RT, and concurrency, as well as protection events and traffic status across different nodes.
  • (Icon ⑤) In the time-series chart area, you can show or hide specific metrics and choose how to display API metrics.
    • node comparison: Displays data for each API on individual cards.
    • cluster statistics: Displays API data aggregated by QPS, RT, and concurrency.

    Click the 下载报告 icon in the upper-right corner to export API data. You can export second-level data for metrics such as QPS and RT for a specific time period. You can export data for up to five APIs at a time in PDF or CSV format.

    Note You can switch display modes only when viewing all APIs.
  • (Icon ⑥) In the time-series chart area, you can also set flow control rules and perform other operations for each API.
    • Click the 添加至大盘.png icon to add the API to a traffic dashboard. This lets you monitor overall system traffic on the dashboard. For more information, see Create a traffic dashboard.
    • Click the 管理规则 or 新增 icon to open the manage rules or add rule dialog box. Here, you can add, delete, or edit flow control, isolation, and circuit breaker rules, as well as enable or disable existing rules. For more information, see Configure flow control rules, Configure isolation rules, and Configure circuit breaker rules.
    • Click the 历史记录 icon to view historical data for the API's metrics.
      Note Historical data is retained for a maximum of 7 days.
    • Click the 下载报告 icon to export data for this API. You can export second-level data, such as QPS and RT, for a specific time period in PDF or CSV format.
    • When you click an API name, the API overview pane on the right displays its data in time-series charts.
      • Click the node details tab to filter and view data from different nodes.
      • Click the status statistics tab to view time-series charts for the API's HTTP status codes and error status codes.
        Note By default, error codes are status codes other than 2xx and 3xx.
      • Click the exception statistics tab to view application exceptions from the last 5 minutes.
        • Click a bar in the Exception Statistics Data bar chart to display the corresponding API, type, and occurrence count for that exception in the Top Exceptions list on the right.
        • In the upper-right corner of the Exception Statistics Data area, click Historical Data to view the number of exceptions within a custom time frame. Historical data is retained for a maximum of 7 days.
        • After you identify exception data in the Exception Statistics section, you can check your application's local logs for detailed exception records.
          Note The console displays exception statistics on a per-second basis. For full exception details, check the local log files.
          • Log file path: The log files are in the same directory as the metrics.log file.
          • Exception record file names:
            • {appName}-ahas_exceptions.log.{date}
            • {appName}-ahas_exceptions.log.{date}.idx
          • Exception record format: {timestamp}|{time, accurate to the millisecond}|{exception_api}|{exception_details}

          Example:

          1619749703000|2021-04-30 10:28:23.062|/exception1|com.alibaba.csp.sentinel.demo.exception.TestException: test exception_1 15
          1619749703000|2021-04-30 10:28:23.065|/exception|com.alibaba.csp.sentinel.demo.exception.AnotherException: test another exception 71
          1619749705000|2021-04-30 10:28:25.065|/exception1|com.alibaba.csp.sentinel.demo.exception.TestException: test exception_1 38

Export API data

AHAS lets you export data for each API, including second-level metrics such as QPS and RT for a specific time period, to aid statistical analysis.

  1. Log on to the AHAS console and select a region in the upper-left corner.

  2. In the left-side navigation pane, choose traffic protection > application protection.

  3. On the application protection page, click the target application card on the application card tab.

  4. In the left-side navigation pane, choose API details.
  5. You can export data in either of the following ways:
    • On the API details page, click the 下载报告 icon in the upper-right corner of the time-series chart area to export data for multiple APIs.
    • In the API list area, click an API name, and then click the 下载报告 icon in the upper-right corner of the time-series chart area to export data for that specific API.
  6. In the Export API Detail Data dialog box, specify the time range, select the APIs, choose an export format, and then click OK.
    导出接口数据.png
    Note You can export data for up to five APIs at a time.