Repository navigation
Description
-
[ X] Review the documentation: https://docs.sentry.io/
https://docs.sentry.io/platforms/javascript/#extraerrordata -
[X ] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
I reported it here previously Deeply Nested objects aren't being serialised #1964 -
[X ] Use the latest release: https://github.com/getsentry/sentry-javascript/releases
5.15.4 -
[X ] Provide a link to the affected event from your Sentry account
https://sentry.io/organizations/systema-ai-pty-ltd/issues/1599729260/events/c5746441802a4762a31f839bfb24e9cc/
Package + Version
-
@sentry/browser - [X ]
@sentry/node -
raven-js -
raven-node(raven for node) - other:
Version:
5.15.4
Description
This seems to have regressed. I have this code to setup Sentry:
import { ExtraErrorData } from '@sentry/integrations';
Sentry.init({
dsn: 'MYDSN',
release: `${Settings.name}@${module.exports.version}`,
integrations: [new ExtraErrorData({ depth: 10 })],
});
And I get this
{
"smart_search": {
"user_id": "[Object]", <<- Note this
"id": "[Array]", <<- Note this
"environment": "prod",
"path": "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/checkout/cart",
"api_key": "<redacted>",
"event": "<redacted>"
},
"original": {
"UserName": "",
"DeviceData": "[Object]", <<- Note this
"Sequence": <redacted>,
"Url": "<redacted>",
"Type": "<redacted>",
"AcquisitionId": "<redacted>",
"ClientId": "<redacted>",
"Environment": "<redacted>",
"Item": "[Object]", <<- Note this
"SessionId": "<redacted>",
"Version": "<redacted>",
"Referer": "<redacted>",
"Geographical": "[Object]", <<- Note this
"Fingerprint": "<redacted>",
"UserAgent": "<redacted>",
"IpAddress": "<redacted>",
"EventDate": "[Object]" <<- Note this
}
}
A quick search finds me #2417 but not why. This seems to be my issue as in the end I am calling setExtra and always have (even in my original issue) so I am going to see if does actually fix it but...
Why does the ExtraErrorData({ depth: 10 }) option no longer work?
Why did this change?
Where is the documentation on normalizeDepth?
What should I actually be doing now? Do I need
Sentry.init({
...
integrations: [new Sentry.Integrations.ExtraErrorData({ depth: 10 })],
normalizeDepth: 5
});
or just
Sentry.init({
...
normalizeDepth: 5
});
Activity
kamilogorek commentedon Apr 20, 2020
@drwharris, unfortunately, you are correct. We had to update the normalization process about 3 months ago in this PR #2404 and it effectively clashed with
ExtraErrorDataoption.It does, however,
normalizeDepthhas to be set to at least the samedepth+1.https://docs.sentry.io/platforms/javascript/#extraerrordata it's missing the above fact. I will update it soon.
Default
depthforExtraErrorDatais3, same as fornormalizeDepth.If that's enough for you, then you only need to set
normalizeDepthto4(which is as explained beforedepth+1).Sorry for the inconvenience. We had to patch this quite rapidly back then.
kamilogorek commentedon Jul 2, 2021
Closing the issue, as it seems like the original issue has been resolved.
Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it.
Cheers!
hckhanh commentedon Sep 24, 2021
hi @kamilogorek, so the integration
ExtraErrorDataandnormalizeDepthhave the same usage, right?hckhanh commentedon Sep 24, 2021
For my current init options of Sentry.
I don't exactly know exactly which options are necessary and which options are not, according to the latest version of Sentry.
kamilogorek commentedon Sep 24, 2021
ExtraErrorDatais used to extract additional, non-default properties from captured exception, eg:this will attach
randomNumberas part of the error context. It defaults to3levels of depth, so eg.err.someObj.nestedObj.randomNumberwill be fine, but anything deeper would be truncated if not overridden.normalizeDepthis the depth of a whole event captured. Because everything thatExtraErrorDataattaches is nested withinevent.contexts, you need to set it to +1 of what you set yourExtraErrorDataintegration to.rchl commentedon Oct 8, 2021
@kamilogorek You've mentioned that you will update documentation with that info but https://docs.sentry.io/platforms/javascript/configuration/integrations/plugin/#extraerrordata still doesn't mention that
normalizeDepthhas to be updated also.It took me a while to figure out why changing
depthinExtraErrorDatadoesn't let me see more of the captured data...kamilogorek commentedon Oct 8, 2021
My bad, I thought I did it - getsentry/sentry-docs#4247
rchl commentedon Oct 8, 2021
Thanks :)
lobsterkatie commentedon Feb 11, 2022
This is in fact not fixed, but is on our list for our upcoming v7 major release. Reopening.
(Note to future self: Make sure this fix applies to
__serialized__as well. Also, see the PR below for an explanation of the underlying problem.)#2404
AbhiPrasad commentedon May 30, 2022
Closed with #5052 and #5053