- Watch the introductory video.
- Test drive Analytics on our simulated data if your app isn't sending data to Application Insights yet.
- SQL-users' cheat sheet translates the most common idioms.
- Language Reference Learn how to use all the powerful features of the Analytics query language.
Queries in Analytics
A typical query is a source table followed by a series of operators separated by
For example, let's find out what time of day the citizens of Hyderabad try our web app. And while we're there, let's see what result codes are returned to their HTTP requests.
requests // Table of events that log HTTP requests. | where timestamp > ago(7d) and client_City == "Hyderabad" | summarize clients = dcount(client_IP) by tod_UTC=bin(timestamp % 1d, 1h), resultCode | extend local_hour = (tod_UTC + 5h + 30min) % 24h + datetime("2001-01-01")
We count distinct client IP addresses, grouping them by the hour of the day over the past 7 days.
To get results outside the previous 24h, either include 'timestamp' explicitly in your query, or use the time range drop-down menu.
Let's display the results with the bar chart presentation, choosing to stack the results from different response codes:
Looks like our app is most popular at lunchtime and bed-time in Hyderabad. (And we should investigate those 500 codes.)
There are also powerful statistical operations:
The language has many attractive features:
- Filter your raw app telemetry by any fields, including your custom properties and metrics.
- Join multiple tables – correlate requests with page views, dependency calls, exceptions and log traces.
- Powerful statistical aggregations.
- Just as powerful as SQL, but much easier for complex queries: instead of nesting statements, you pipe the data from one elementary operation to the next.
- Immediate and powerful visualizations.
- Pin charts to Azure dashboards.
- Export queries to Power BI.
- There's a REST API that you can use to run queries programmatically, for example from Powershell.
Connect to your Application Insights data
Open Analytics from your app's overview blade in Application Insights:
- Tour of Analytics
- Start here. A tutorial covering the main features.
- Use operators such as
countto build queries.
- Use operators such as
- Used to compute statistics over groups of records
- Numbers, strings, and other expressions used to form query parameters.
- Using Analytics
- Using Analytics.
- Language Reference
- One-page reference.
Try these walkthroughs to illustrate the power of using Analytics:
- Automatic diagnostics of spikes and step jumps in requests durations
- Analyzing performance degradations with time series analysis
- Analyzing application failures with autocluster and diffpatterns
- Advanced shape detections with time series analysis
- Using sliding window operations to analyze application usage (rolling MAU/DAU etc)
- Detection of service disruptions based on analysis of debug logs and a matching blog post here.
- Profiling applications’ performance using simple debug logs and a matching blog post here
- Measuring the duration for each step in your code flow using simple debug logs and a matching blog post here
- Analyzing concurrency using simple debug logs and a matching blog post here