-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Use contexts
to handle ExtraErrorData
#2208
feat: Use contexts
to handle ExtraErrorData
#2208
Conversation
Hey! Looks really nice! I think it may be a useful addition :) |
Possible names: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We slowly want to discourage the usage of extra
.
WDYT @kamilogorek if we create a new context containing all the data of the error object?
like:
contexts: {
error: {
....
}
}
@HazAT that'd work as well! |
@kamilogorek with this new context usage then is this PR still relevant? Do you plan to use this new context soon in a next version? |
@CPatchane it's already available in the Sentry and in the SDK. We can change this PR to reflect it. What has to be done is:
return {
...event,
extra,
}; it should be return {
...event,
contexts,
}; where contexts = {
...event.contexts,
...normalizedErrorData,
}; |
8990467
to
a80672f
Compare
toRoot
option for ExtraErrorData integrationcontexts
to handle ExtraErrorData
@CPatchane context still has to have a name (my bad by explaining it incorrectly, sorry) {
contexts: {
error: {
// extra data goes here
}
}
} The name will be used to well "name" the UI block as shown in my screenshot above. |
Ok I was wondering myself about this part also, I change that 馃憤 |
a80672f
to
005430b
Compare
@@ -35,7 +35,7 @@ describe('ExtraErrorData()', () => { | |||
originalException: error, | |||
}); | |||
|
|||
expect(enhancedEvent.extra).toEqual({ | |||
expect(enhancedEvent.contexts).toEqual({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test still relevant?
005430b
to
465093e
Compare
馃 The tests all pass green in my local environment, do you see what's wrong? |
They work just fine locally for me as well. Can you try to add this snippet to
Current version Travis use by default is 15 versions old. |
@CPatchane actually nevermind, just update a whole ubuntu distro :) Change |
Fixed :) I wonder what happened that it broke all of a sudden. Code looks good to me. WDYT @HazAT? |
Any news @kamilogorek / @HazAT ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thx 馃檹
Thanks for the ping :) Will make a release at the end of the week. Cheers! |
Hi here 馃憢
We used to have a custom event processor to add extra data to our events and we saw that there is now an integration to handle that:
ExtraErrorData
which is cool to remove our custom processor :)The thing is that (I don't know if it was wanted), this integration extracts all information into an object using the event name like:
UI Preview:
This object is less well formatted on the Sentry interface compared to having all information at the extra object root like:
UI Preview:
So this PR adds a new option
toRoot
(I am clearly opened if you have a better option name, I was not inspired), disabled by default, to allow putting all extra information to the event object root and overwriting if there were already existing extra information the same attributes.