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.

addTelemetryInitializer not called when initializing with ReactAI.init #71

@lkohn

Description

@lkohn

Hi,
There is an issue I've run into where when using addTelemetryInitializer to add custom meta data where it is not being called when initializing appinsights through React.AI but it does when initializing through AppInsights.downloadAndSetup.

Here is the code snippet I have for setting up the initializer:
`
AppInsights.queue.push(function() {
AppInsights.context.addTelemetryInitializer(function(envelope) {
const telemetryItem = envelope.data.baseData;
const userMeta = extractUserProfileFromState(store.getState());

telemetryItem.properties = telemetryItem.properties || {};
telemetryItem.properties["Application"] = APP_SETTINGS.moduleId;
if (userMeta) {
  telemetryItem.properties["User Name"] = userMeta.id;
}

});
});
Initializing throughAppInsights.downloadAndSetup` seems work even for the React component performance tracking so I'm inclined to leave it since everything is working now. I'm not sure if this is by design / a quirk / a bug but I figured you would want to know.

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