Search code examples
webazure-application-insights

Azure ApplicationInsights Web custom events


I am trying to setup azure applicationinsights for my SPA app.

Additionaly to default metrics I wan't to log some custom things like in this example: resolution and tenant name.

Event seems to be send correctly however in azure portal I see these values as undefined:

enter image description here

What should I configure to have these values visible?

import { ApplicationInsights } from '@microsoft/applicationinsights-web';

const appInsights = new ApplicationInsights({
    config: {
        instrumentationKey,
        enableAutoRouteTracking: true
    }
});

appInsights.loadAppInsights();
appInsights.trackPageView();
appInsights.trackEvent({
    name: "Resolution",
    properties: {
        width: 300,
        height: 500,
        tenant: 'some tenant name'
    },
});


Solution

  • Excuse me sir, could you pls add more details on your problem?

    I added app sights in my react app, and I found it's ok to see the custom events in log query.

    enter image description here enter image description here