Skip to content
This repository was archived by the owner on May 22, 2019. It is now read-only.
This repository was archived by the owner on May 22, 2019. It is now read-only.

Remove initial route track persisting #85

@yasso1am

Description

@yasso1am

Not sure how to apply a "Question" label but that's what this is:
version = "react-appinsights": "^3.0.0-rc.6",

I really appreciate that the initial route is tracked upon entry of the app, however it appears this context is remaining for every future call in my custom dimensions.

Screen Shot 2019-04-25 at 6 07 58 PM

You can see in this screenshot I enter at /login and localhost:3000/login persists in the custom dimensions even though I am never setting that.

Here is my helper class:

import env from '../environment';
import { reactAI } from 'react-appinsights';
import { ApplicationInsights, ITraceTelemetry } from '@microsoft/applicationinsights-web';
import { ICustomProperties } from '@microsoft/applicationinsights-core-js';

import { history } from './history';

class Insights {
  private ai: ApplicationInsights;
  constructor() {
    this.ai = new ApplicationInsights({
      config: {
        instrumentationKey: `${env.appInsights.instrumentationKey}`,
        extensions: [reactAI],
        extensionConfig: {
          [reactAI.extensionId]: {
            debug: true,
            history: history,
          }
        }
      }
    });
    this.ai.loadAppInsights();
  }

const AppInsightsService = new Insights();

export { AppInsightsService };

after calling this.ai.loadAppInsights() I tried calling reactAI.setContext({}) to remove any customDimensions but that did not help.

Any suggestions?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions