-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
7.101.1
Framework Version
No response
Link to Sentry event
SDK Setup
init({
tracesSampleRate: 1.0,
...params,
autoSessionTracking: true,
integrations: [
browserTracingIntegration(),
...(params.integrations || []),
],
Steps to Reproduce
Prior to v7.87.0 we were able to use setExtra
and see the information in the ui, we set the data like this:
const { method, statusCode, path, stack } = errorResponse;
const request = context.getRequest<ExtendedRequest>();
const scope = new Scope();
if (request.currentUser) {
scope.setUser(request.currentUser);
} else if (request.currentCompany) {
scope.setUser(request.currentCompany);
}
scope.setExtras({
...(!isEmpty(request.currentScopes) && {
[SentryExtrasProps.access_scopes]: request.currentScopes,
}),
[SentryExtrasProps.request_id]: request.requestId,
[SentryExtrasProps.stack]: stack,
[SentryExtrasProps.http_headers]: request.headers,
[SentryExtrasProps.http_method]: request.method,
[SentryExtrasProps.http_params]: request.params,
[SentryExtrasProps.http_query]: request.query,
[SentryExtrasProps.http_body]: request.body,
[SentryExtrasProps.error_message]: errorResponse.message,
[SentryExtrasProps.error_details]: errorResponse.details,
});
const mode = extractModeFromHttpRequest(request);
scope.setTags({
requestId: request.requestId,
statusCode,
method,
path,
protocol: 'http',
...(mode ? { mode } : {}),
...tags,
});
We used to use setExtra
but that stopped working in v7.87.0, so we switched to setExtras
, but that seemed to stop working in v7.89.0.
There is no deprecated tag on either of those methods, and in the release notes for v7.101.1 it says:
feat(core): Write data from setUser, setTags, setExtras, setTag, setExtra, and setContext to isolation scope ([#10163](https://github.com/getsentry/sentry-javascript/pull/10163))
so it appears that they are still in use.
However in the docs (https://docs.sentry.io/platforms/javascript/enriching-events/context/#additional-data) it says the following:
Additional Data is deprecated in favor of structured contexts.
Sentry used to support adding unstructured "Additional Data" via setExtra.
As you can see in the screenshot, we could previously see all this information:
Since v7.89.0 all that information is missing.
Expected Result
I should still be able to see that extra information in the UI. There should be clear documentation and deprecated tags if setExtra
and setExtras
are no longer to be used.
Actual Result
Metadata
Metadata
Assignees
Labels
Projects
Status