Get API analytics in Azure API Management
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.
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. Equivalent data is shown in the Azure Monitor-based dashboard and built-in analytics. 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.
- In the Azure portal, navigate to your API Management instance.
- In the left-hand menu, under Monitoring, select Diagnostic settings > + Add diagnostic setting.
- Enter a descriptive name for the diagnostic setting.
- In Logs, select Logs related to ApiManagement Gateway.
- 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.
- Make sure Resource specific is selected as the destination table.
- 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.
- In the Azure portal, navigate to your API Management instance.
- In the left-hand menu, under Monitoring, select Analytics. The analytics dashboard opens.
- Select a time range for data.
- 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:
- In the Azure portal, navigate to your API Management instance.
- In the left-hand menu, under Monitoring, select Analytics (classic).
- Select a time range for data, or enter a custom time range.
- Select a report category for analytics data, such as Timeline, Geography, and so on.
- 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.
Related content
- For an introduction to Azure Monitor features in API Management, see Tutorial: Monitor published APIs
- For detailed HTTP logging and monitoring, see Monitor your APIs with Azure API Management, Event Hubs, and Moesif.
- Learn about integrating Azure API Management with Azure Application Insights.