Azure AppInsights Integration


#1

Greetings,

I am looking for ideas on how to capture better information for Aurelia applications. I use .Net Core with Web API for the back-end and Typescript on the front end. What I get out of the box is helpful but actual page information is generic and assigned to GET Home/Index. Fortunately, all fetches are fairly well identified.

As a quick test, I tried this in a PreActivate step:

import { NavigationInstruction } from 'aurelia-router';

export class PreActivateAppInsights {
    run(navigationInstruction: NavigationInstruction, next: any) {
        window.appInsights.trackPageView(navigationInstruction.config.name);
        return next();
    }
}

That started capturing events that I could associate with actual page flow. I also tried using the startTrackPage and stopTrackPage events in a PostRender stop, which seemed to get lost even though it looked like the telemetry was sent.

Having the events broken down is better but what I would really like is to just break up my GET Home/Index performance events with something based on the route like the name or route. It looks like the Operation Context might help with that but the examples are server-side.

I appreciate any ideas or help!


#2

Hello again, I found an interesting project that Microsoft has integrated into Azure Application Insights. It is called Mezzurite and has plugins for React and Angular. The Angular plugin looks like it could be used as a base for an Aurelia plugin.


#3

We also plan to use Application Insight and have a .net core backend that serve aurelia apps. In our case we envision starting by injecting the application insight into pages from .net core at first. For now we care mostly about crashes so that solution seems ok for now. I’ve stumbled upon a plugin that seems pretty good for Aurelia but not sure if it is still alive and if it is working properly with latest version of application insight. You should have a look, let me know how it works out.