Azure AppInsights Integration

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 Likes

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.

5 Likes

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.

2 Likes

Thank you for the suggestions @kbeaudoin. I am getting pretty good crash and failure information using the standard tooling with AppInsights and the snapshot collector telemetry processor. I went ahead and started posting events using the PreActivate hook and that is close to what I wanted. From what I have now, I can see fairly complete application state as well as the path that led to the failure.

I took a look at the aurelia-application-insights plugin you mentioned and I don’t think it provides a way of understanding end to end request performance. It appears to capture route and click events but no end-to-end request performance. Getting that performance information would be ideal but looks like it would be some work. Mezzurite seems to be a good starting point for that type of logging.

Thank you!

1 Like