From 9980a480005c22fe5c9030e19d5d56b8377d7486 Mon Sep 17 00:00:00 2001 From: Luca Forstner Date: Thu, 13 Apr 2023 14:26:01 +0000 Subject: [PATCH] meta: Update changelog to incorporate #7849 and #7850 --- CHANGELOG.md | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85b4325081ca..10be5e8ef625 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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(); + }); }); }; ```