संपादित करें

इसके माध्यम से साझा किया गया


Get API analytics in Azure API Management

APPLIES TO: Developer | Basic | Basic v2 | Standard | Standard v2 | Premium

Azure API Management provides analytics for your APIs so that you can analyze their usage and performance. Use analytics for high-level monitoring and troubleshooting of your APIs. For other monitoring features, including near real-time metrics and resource logs for diagnostics and auditing, see Tutorial: Monitor published APIs.

Screenshot of API analytics in the portal.

Note

Currently, this feature isn't available in workspaces.

About API analytics

  • API Management provides analytics using an Azure Monitor-based dashboard. The dashboard aggregates data in an Azure Log Analytics workspace.

  • In the classic API Management service tiers, your API Management instance also includes legacy built-in analytics in the Azure portal, and analytics data can be accessed using the API Management REST API. Closely similar data is shown in the Azure Monitor-based dashboard and built-in analytics.

Important

  • The Azure Monitor-based dashboard is the recommended way to access analytics data.
  • Built-in (classic) analytics isn't available in the v2 tiers.

With API analytics, analyze the usage and performance of the APIs in your API Management instance across several dimensions, including:

  • Time
  • Geography
  • APIs
  • API operations
  • Products
  • Subscriptions
  • Users
  • Requests

Note

  • API analytics provides data on requests, including failed and unauthorized requests.
  • Geography values are approximate based on IP address mapping.
  • There may be a delay of 15 minutes or more in the availability of analytics data.

Azure Monitor-based dashboard

To use the Azure Monitor-based dashboard, you need a Log Analytics workspace as a data source for API Management gateway logs.

If you need to configure one, the following are brief steps to send gateway logs to a Log Analytics workspace. For more information, see Tutorial: Monitor published APIs. This is a one-time setup.

  1. In the Azure portal, navigate to your API Management instance.
  2. In the left-hand menu, under Monitoring, select Diagnostic settings > + Add diagnostic setting.
  3. Enter a descriptive name for the diagnostic setting.
  4. In Logs, select Logs related to ApiManagement Gateway.
  5. In Destination details, select Send to Log Analytics and select a Log Analytics workspace in the same or a different subscription. If you need to create a workspace, see Create a Log Analytics workspace.
  6. Make sure Resource specific is selected as the destination table.
  7. Select Save.

Access the dashboard

After a Log Analytics workspace is configured, access the Azure Monitor-based dashboard to analyze the usage and performance of your APIs.

  1. In the Azure portal, navigate to your API Management instance.
  2. In the left-hand menu, under Monitoring, select Analytics. The analytics dashboard opens.
  3. Select a time range for data.
  4. Select a report category for analytics data, such as Timeline, Geography, and so on.

Legacy built-in analytics

In certain API Management service tiers, built-in analytics (also called legacy analytics or classic analytics) is also available in the Azure portal, and analytics data can be accessed using the API Management REST API.

Built-in analytics - portal

To access the built-in (classic) analytics in the Azure portal:

  1. In the Azure portal, navigate to your API Management instance.
  2. In the left-hand menu, under Monitoring, select Analytics (classic).
  3. Select a time range for data, or enter a custom time range.
  4. Select a report category for analytics data, such as Timeline, Geography, and so on.
  5. Optionally, filter the report by one or more other categories.

Analytics - REST API

Use Reports operations in the API Management REST API to retrieve and filter analytics data for your API Management instance.

Available operations return report records by API, geography, API operations, product, request, subscription, time, or user.