Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Custom properties added with addTelemetryInitializer are ignored for exceptions #1262

Closed
Trenrod opened this issue May 5, 2020 · 5 comments · Fixed by #1308
Closed
Assignees
Milestone

Comments

@Trenrod
Copy link

Trenrod commented May 5, 2020

Description/Screenshot
Custom properties added with addTelemetryInitializer are ignored for exceptions

Custom property session_id is only send for custom events. It is not send with any exception
image

Steps to Reproduce
init telemetry with custom properties

        const telemetryInitializer = (item: ITelemetryItem) => {
            if (item.data !== undefined) {
                item.data.session_id = theConferenceController.getClientSessionIdentifier();
            }
        };
        appInsights.loadAppInsights();
        appInsights.addTelemetryInitializer(telemetryInitializer);

Calling examples

      getAppInsights()?.trackEvent({name: "TEST"});
      throw Error("This is just a test, calm down");
    } catch (error) {
      getAppInsights()?.trackException(error);

Expected behavior
session_id should also be send on exception like it is send when custom events are triggered.

Additional context
No

@Trenrod Trenrod changed the title [BUG] [BUG] Custom properties added with addTelemetryInitializer are ignored for exceptions May 5, 2020
@MSNev
Copy link
Collaborator

MSNev commented May 13, 2020

This is an issue with the way that the exception envelope is created.
I have a work item around enhancing the way the exceptions are serialized (part of a fix for #363), I'll see if I can address this at the same time.

@MSNev MSNev self-assigned this May 13, 2020
@MSNev
Copy link
Collaborator

MSNev commented May 13, 2020

I'm also tagging as an enhancement as it appears to have been like this for a while -- it assumes that custom properties are passed to the trackException() which they aren't for automatically caught exceptions

@riteshbhoi
Copy link

i had raised this issue almost a year back and it was closed stating this was fixed.
reference: #954

MSNev pushed a commit that referenced this issue Jul 1, 2020
MSNev added a commit that referenced this issue Jul 2, 2020
@MSNev MSNev added the fixed - waiting release PR Committed and waiting deployment label Jul 2, 2020
@MSNev MSNev added this to the 2.5.6 milestone Jul 2, 2020
@MSNev MSNev removed the fixed - waiting release PR Committed and waiting deployment label Jul 8, 2020
@MSNev
Copy link
Collaborator

MSNev commented Jul 8, 2020

Release is now fully deployed

@MSNev MSNev closed this as completed Jul 8, 2020
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants