The App Insights tile allows you to query Application Insights data (both stand-alone and in the context of resources within Azure) and display that information in your SquaredUp dashboard.
The App Insights tile button indicates that there are more tiles available from this one button:
After selecting the App Insights tile you will get the choice of App Insights Scalar or App Insights Grid.
Scalar will show a single value:
Grid will show a table of data:
Overview
SquaredUp executes the requests in the context of the logged in user viewing the dashboard.
The ability to render information as a graph is a feature of the Azure portal rather than the App Insights Query language itself. At this time any queries run using the render
statement will still return tabular or scalar data rather than graphs, depending on the tile.
Configuring the App Insights tile
Scope
The scope is optional, and allows you to select Azure resources to inject into the query.
For more information see How to scope tiles
Timeframe
By default the tile will not return any entries older than 24 hours. You can use the timeframe panel to control this behaviour and select various values, even when your query doesn't specify a timeframe. If you attempt to load a large timeframe that may contain many thousands of records, this may cause significant browser delays.
Within each tile configuration you can choose either to use page timeframe, which allows users viewing the page to change the timeframe on the fly, or for you to set a specific timeframe which will be fixed.
For more information on how to use the tile timeframe see How to use Timeframe option.
Take care when extending the timeframe beyond 7 days, as this may pull many thousands of entries and significantly impact browser performance. If you are planning on changing the page timeframe beyond 7 days then it may be worth switching to the specific timeframe option within the tile configuration instead.
If your query specifies a timeframe
It is also possible to specify a timeframe in the query (e.g. where timestamp >= ago(2h)
), however events must satisfy both the timeframe specified in the tile and in the where clause.
If you want to control the timeframe using only the query, set the tile timeframe to specific timeframe > all.
You may like to consider using the page timeframe, and adding a "clamping" timeframe in the query (such as where timestamp >= ago(7d)
). When the page timeframe is less than 7 days it will be used, but once the page timeframe exceeds 7 days the query will enforce the max time.
Application
This is your App Insights application. For more information see What is Application Insights?
It is not possible to query multiple applications on a single tile, because the Azure API in use does not support cross-resource queries.
Query
The App Insights query language (AIQL) is very rich and offers features such as sorting, projection and calculated values, which you can use to control the display of data in your dashboard.
The new Azure API does not support cross-resource queries.
Grid columns
As a best practise, once you know which columns you want to display, modify the App Insights query to only return those columns (via project
or project away
), as it will improve performance when loading and displaying the tile. You can also hide individual columns by clicking the hide link next to the column name.
You can also customise the appearance of columns by clicking the edit link next to it's name in the grid columns panel and then specifying a custom template. One of the most used customisation is to set the timestamp column template to {{timeago(value)}}
to show a friendly time in the form Last x minutes
rather than the specific time. For more information see How to use the Grid designer when configuring tiles.
Grid options
The grid options section allows you to create hyperlinks from rows of data when using the grid tile. You can also create dynamic URLs using the data returned. For example, you could paste in your Azure portal URL and append {{ResourceId}}
to create a dynamic URL: https://portal.azure.com/#@squaredup.net/resource/{{ResourceId}}
Walkthrough: Query request performance information
It's useful to use the Azure portal to prepare and test your queries first, see the links at the bottom of this article for further information. For this walkthrough, you are going to query response time performance information aggregated into hourly values.
- In SquaredUp browse to the dashboard you wish to add the App Insights tile to.
-
Click on the orange + button to add a new tile, then click on App Insights > App Insights (Grid)
-
The scope is optional, and allows you to select Azure resources to inject into the query. For this walkthrough you can leave the scope empty.
For more information see How to scope tiles
- Leave the timeframe as use page timeframe.
- In the application section select a App Insights application from the drop down list.
-
On the query panel, enter the following App Insights Query:
requests | summarize percentiles(duration, 50, 90, 95) by bin(timestamp, 1h)
- The grid columns section allows you to hide and edit columns. For this walkthrough hide some columns you don't need to see by clicking the hide link next to them.
- You can now customise the timestamp column by clicking the edit link next to it's name in the grid columns panel. In the custom template box paste in
{{timeago(value)}}
to show a friendly time in the formLast x minutes
. For more information see How to use the Grid designer when configuring tiles. - Leave the grid options section as it is for this walkthrough.
- Click done.