This site describes a set of REST APIs created to make data collected by Application Insights easily available. Using these APIs you can build new visualizations of your application's data and extend the capabilities of Application Insights.
The following documentation will describe in detail how to use these APIs. To test these APIs yourself, you can use this site's API Explorer which will enable you to form and execute queries, as well as give me requests formatted to execute from the command line with cURL.
As you go through this documentation, please note that your feedback is
important to us. You can submit ideas or requests for new features at the Application
Insights UserVoice site,
by asking questions at StackOverflow,
using the tag
ms-application-insights or at the Application Insights MSDN forum.
There are several APIs which can be applied to building a variety solutions using data from Application Insights.
Metrics: this is a REST API which allows users to retrieve metric data such as the number of exceptions each hour for the last day. It allows users to specify a metric name, a timespan, time intervals, the type of aggregation (sum, average, minimum or maximum) and the property over which to segment the data. There is a corresponding metadata path which returns the available metrics and information about them such as support aggregation types and segmentation properties.
Events: this is a REST API which allows users rich
capabilities to access their event data using OData
syntax. The API supports
$format, so that it can be used to both return individual event
data as well as aggregate over specific sets of events. This also supports
$metadata which returns the set of data types and their properties.
Query: the query API is designed to enable users API access to the same data using the same queries as they do with Application Insights Analytics. There is also a schema path which returns the schema in which data will be returned.
Here are two ways to try the API without writing any code:
The API Explorer provides a simply way to explore each of these APIs.
To try these APIs from the command line, you can use cURL and then
piping the output into jsonlint to get readable JSON.
(Note that the API Explorer provides the cURL command as an additional tab in the Request
section in the top right of the page.) To install Jsonlint, use the command
npm install -g jsonlint.