Description/Screenshot
When using exception tracking with custom properties, we can't see that trackException is collecting them and sending with along with the exception's baseData to Application Insights.
Looking at https://github.com/microsoft/ApplicationInsights-JS/blob/a7f41a2f76a5143643b9195975eb84b50740aafb/channels/applicationinsights-channel-js/src/EnvelopeCreator.ts#L289-L303 I think that this is why it isn't working. We're missing a line similar to EnvelopeCreator.extractPropsAndMeasurements(telemetryItem.data, customProperties, customMeasurements); in the function above.
Steps to Reproduce
appInsights = new ApplicationInsights({
config: {
instrumentationKey: instrumentationKey,
enableCorsCorrelation: false,
disableAjaxTracking: false,
disableCorrelationHeaders: false,
enableDebug: true
}
Expected behavior
When calling:
trackException(new Error('myerror'), { custom1: '1', custom2: '2'})
I expect to a properties array on baseData when the SDK calls POST https://dc.services.visualstudio.com/v2/track with the exception, where the array contains the two objects sent to the trackException-function.
Related issue for the same problem but for Trace and Metrics: https://github.com/microsoft/ApplicationInsights-JS/pull/1065
Hi @HenrikWM , please use the new API:
appInsights.trackException({
exception: new Error('some error'),
properties: {'custom': '1'}
});
Related issue: https://github.com/microsoft/ApplicationInsights-JS/issues/1079
Most helpful comment
Hi @HenrikWM , please use the new API:
Related issue: https://github.com/microsoft/ApplicationInsights-JS/issues/1079