Skip to content

meta: Update changelog to incorporate #7849 and #7850 #7851

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

Merged
merged 1 commit into from
Apr 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,26 @@ This release switches the SDK to use [`AsyncLocalStorage`](https://nodejs.org/ap
If you want to manually add async context isolation to your application, you can use the new `runWithAsyncContext` API.

```js
import * as Sentry from '@sentry/node';

const requestHandler = (ctx, next) => {
return new Promise((resolve, reject) => {
Sentry.runWithAsyncContext(
async hub => {
hub.configureScope(scope =>
scope.addEventProcessor(event =>
Sentry.addRequestDataToEvent(event, ctx.request, {
include: {
user: false,
},
})
)
);

await next();
resolve();
},
{ emitters: [ctx] }
);
Sentry.runWithAsyncContext(async () => {
const hub = Sentry.geCurrentHub();

hub.configureScope(scope =>
scope.addEventProcessor(event =>
Sentry.addRequestDataToEvent(event, ctx.request, {
include: {
user: false,
},
})
)
);

await next();
resolve();
});
});
};
```
Expand Down