5 minute readApplies to: v4

How to use the App Insights tile

The App Insights tile allows you to query App 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:

App Insights Tile 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:

App Insights Scalar button

Grid will show a table of data:

App Insights Grid button

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

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 App Insights tile configuration instead.

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.

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.

For more information see How to use Timeframe option.

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.

  1. In SquaredUp browse to the dashboard you wish to add the App Insights tile to.
  2. Click on the orange + button to add a new tile, then click on App Insights > App Insights (Grid)

    App Insights Tile button

    App Insights Grid button

  3. 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

  4. Leave the timeframe as use page timeframe.
  5. In the application section select a App Insights application from the drop down list.
  6. On the query panel, enter the following App Insights Query:

    requests
    | summarize percentiles(duration, 50, 90, 95) by bin(timestamp, 1h)
  7. 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.
  8. 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 form Last x minutes. For more information see How to use the Grid designer when configuring tiles.
  9. Leave the grid options section as it is for this walkthrough.
  10. Click done.

Restricting data to a specific 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. If you attempt to load a large timeframe that may contain many thousands of records, this may cause significant browser delays. You can also include further timeframe restrictions in your query (such as where timestamp >= ago(2h)) if you need more granularity, but be aware events must satisfy both where clauses and the timeframe settings).

Azure App Insights Query Language

How to use the Grid designer when configuring tiles

Squared Up Ltd. (c) 2020Report an issue with this article