In today’s rapidly changing ecosystem, monitoring the performance of your website is essential for acquiring insight into your clients and users, as well as keeping an eye on the website’s overall performance. Thus, as a roadmap strategy, organisations across the globe are moving their applications onto the cloud at an astonishing speed and scale. The core focus is to bring the best experience to their users by leveraging the capabilities of the cloud-based solutions.
Application Insights is a web application performance management solution that allows you to handle all your website performance monitoring in Azure. The architecture is designed to make sure your website performs at its best and provides the finest user experience possible. It also includes a robust analytic tool that aids in the diagnosis of problems and the knowledge of how users interact with your web application.
However, once set up and configured, Azure Application Insight automatically detects performance anomalies. It includes powerful analytics tools to aid you to diagnose issues and understand what users do with your app. But what if you want to incorporate this Azure Application Insight data into your own custom Application Performance Management (APM) and extend the capabilities of Application Insights for different purposes?
The article aims to give a detailed description on how you can make Azure Application Insight Data available outside azure using Azure Application Insights REST API and the cost factors you should take into consideration.
The Application Insights REST API lets you query the telemetry data that Application Insights records about your application.
Following steps are involved for consuming the Application Insights data using Azure Application Insights REST API:
- The first step is to setup the Application Insights resource for the application which you want to monitor and get the telemetry data for
- The next step is to note down the application ID and generate an API key by using API Access option available under your app insight resource. This application ID and API key will be required to identify the application and authorize the access to telemetry data of app insight
- Lastly, you can now make calls against the Azure Application Insights REST API end points to get the desired data.
The Azure Application Insights REST API provides APIs for metrics, events & query to retrieve the telemetry data from Azure Application Insights.
Refer the https://dev.applicationinsights.io/ for details of available metrics, events & query.
Additionally, you can use API Explorer (applicationinsights.io) or any other standard API testing tool like Postman to test APIs.
The Azure Application Insights REST API has the below format where {app-id} and {key} are the value of AppID and API Key retrieved in step 2.
https://api.applicationinsights.io/{version}/apps/{app-id}/{operation}/[path]?[parameters]
X-API-Key:{key}
Example: Get the number of Failed requests in past 30 days.
API URL: https://api.applicationinsights.io/v1/apps/0ad06b29-d412-4a1e-xxxx-bxxxxxxxxxb/metrics/requests/failed?timespan=P30D
Cost Consideration: Azure Application Insights is part of Azure Monitor and incurs the cost in two ways as mentioned below.
- Cost associated with Application Insight resource:
You must first configure Application Insight for the application you wish to monitor in order to ingest telemetry data from it. Azure Application Insights charges for the data they consume as well as the length of time log data is retained. As a result, you should compute the projected cost depending on the price tier before using Application Insight. For further information, see Pricing – Azure Monitor | Microsoft Azure and Pricing Calculator | Microsoft Azure.
- Cost associated with Data Egress:
When you use the Azure Application Insights REST APIs to query telemetry data from an application, you are basically conducting data egress, or transferring data out of Azure data centres. This may result in bandwidth costs depending on the volume of data. As a result, you should include the cost of data egress in your total cost estimate. For further information on bandwidth prices, see Pricing Calculator | Microsoft Azure.