Planner Gantt Chart – looking back

You may have noticed that I published a new version of my Planner Gantt Chart app the 8th of December last year. I didn’t make big fuzz about it, the update was merely adding an instumentation key to the app.

Unfortunately I realized to add the instrumentation key only that late – even though the app has been downloadable for almost two years already. Therefore it is good to acknowledge that all the numbers presented in this post are from users who are using the app downloaded from my repository after the 8th of December 2022 – and assuming that the app owner has not removed the instrumentation key from the app.

Configuring Application Insights instrumentation key

If you didn’t know, you can track your app’s activity in Azure Application Insights by simply configuring the instrumentation key in App object’s property pane (see below).

You can fetch the instrumentation key from the Overview blade of your Application Insights resource.

Once you have that configure and your app is being used, you start to get insights to you app usage such as below.

Above we can see that within last 24 hours there have been 152 unique sessions and most of them coming from Japan.

Get some reports out of it!

Of course, since I know a little bit of Power BI as well, I wanted to fetch the data and create some report views on top of it. This is quite easy, since Application Insights provides you with a ready-made M query that you can use in Power BI Desktop.

Depending on your KQL query you are using above, you get an M query similar to this:

/*
The exported Power Query Formula Language (M Language ) can be used with Power Query in Excel
and Power BI Desktop.
For Power BI Desktop follow the instructions below: 
1) Download Power BI Desktop from https://powerbi.microsoft.com/desktop/
2) In Power BI Desktop select: 'Get Data' -> 'Blank Query'->'Advanced Query Editor'
3) Paste the M Language script into the Advanced Query Editor and select 'Done'
*/


let AnalyticsQuery =
let Source = Json.Document(Web.Contents("https://api.applicationinsights.io/v1/apps/0d29f3e3-.../query", 
[Query=[#"query"="traces 
",#"x-ms-app"="AAPBI",#"timespan"="P1D",#"prefer"="ai.response-thinning=true"],Timeout=#duration(0,0,4,0)])),
TypeMap = #table(
{ "AnalyticsTypes", "Type" }, 
{ 
{ "string",   Text.Type },
{ "int",      Int32.Type },
{ "long",     Int64.Type },
{ "real",     Double.Type },
{ "timespan", Duration.Type },
{ "datetime", DateTimeZone.Type },
{ "bool",     Logical.Type },
{ "guid",     Text.Type },
{ "dynamic",  Text.Type }
}),
DataTable = Source[tables]{0},
Columns = Table.FromRecords(DataTable[columns]),
ColumnsWithType = Table.Join(Columns, {"type"}, TypeMap , {"AnalyticsTypes"}),
Rows = Table.FromRows(DataTable[rows], Columns[name]), 
Table = Table.TransformColumnTypes(Rows, Table.ToList(ColumnsWithType, (c) => { c{0}, c{3}}))
in
Table
in AnalyticsQuery

For my puropose I wanted to increase the timespan value to fetch more of the logs. I changed the timespan property to value P365D (= 365 days, 1 year).

Please note, that by default Application Insights only keeps the logs for quite a short period of time, but luckily you can configure it via Log Analytics workspace’s Usage and estimated costs blade’s Data Retention panel.

I have set it to 365 days matching the value I have in the M query. (I need to remember to increase the numbers before next December šŸ˜…)

With all that set up and the query configured in my Power BI Desktop app, I finally created these two report pages.

I’m very excited to see that as of today (March 15th 2023) my app already has 1311 distinct users! (And remember, the real number is something much higher, since I only added the instrumentation key last December)

And it is also very nice to notice that approximately ten new users start using my app every day šŸ„³

And Japan is becomming my new favourite country, as this second report page indicates…

Arigato gozaimasu!

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s