Skip to content

Commit 4b17cdc

Browse files
authored
Merge branch 'master' of https://github.com/getsentry/sentry-docs into rework-node-docs
2 parents 259a4b6 + 431dee6 commit 4b17cdc

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

src/platform-includes/configuration/integrations/default-integrations/node.mdx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,39 @@ Sentry.init({
135135
});
136136
```
137137

138+
### RequestData
139+
140+
_(New in version 7.17.1.)_
141+
142+
_Import name: `Sentry.Integrations.RequestData`_
143+
144+
This integration adds data from incoming requests to transaction and error events that occur during request handling.
145+
146+
Available options:
147+
148+
```javascript
149+
{
150+
// Controls what types of data are added to the event
151+
include: {
152+
cookies: boolean // default: true,
153+
data: boolean // default: true,
154+
headers: boolean // default: true,
155+
ip: boolean // default: false,
156+
query_string: boolean // default: true,
157+
url: boolean // default: true,
158+
user: boolean | {
159+
id: boolean // default: true,
160+
username: boolean // default: true,
161+
email: boolean // default: true,
162+
},
163+
},
164+
// Controls how the transaction will be reported. Options are 'path' (`/some/route`),
165+
// 'methodPath' (`GET /some/route`), and 'handler' (the name of the route handler
166+
// function, if available)
167+
transactionNamingScheme: string // default: 'methodPath',
168+
};
169+
```
170+
138171
### Removing an Integration
139172

140173
This example removes the default-enabled `Console` integration:

src/platforms/node/common/configuration/integrations/default-integrations.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ redirect_from:
77
description: "Learn about default integrations, what they do, and how they hook into the standard library or the interpreter itself."
88
---
99

10-
<PlatformContent includePath="configuration/integrations/default-integrations" />
10+
<PlatformContent includePath="configuration/integrations/default-integrations" />

src/platforms/node/guides/azure-functions/index.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,10 @@ module.exports = async function(context, req) {
3030
try {
3131
await notExistFunction();
3232
} catch (e) {
33-
Sentry.captureException(e);
33+
Sentry.withScope(scope => {
34+
scope.setSDKProcessingMetadata({ request: req });
35+
Sentry.captureException(e);
36+
});
3437
await Sentry.flush(2000);
3538
}
3639

src/platforms/node/guides/koa/index.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ const app = new Koa();
3131
Sentry.init({ dsn: "___PUBLIC_DSN___" });
3232

3333
app.on("error", (err, ctx) => {
34-
Sentry.withScope((scope) => {
35-
scope.addEventProcessor((event) => {
36-
return Sentry.addRequestDataToEvent(event, ctx.request);
37-
});
34+
Sentry.withScope(scope => {
35+
scope.setSDKProcessingMetadata({ request: ctx.request });
3836
Sentry.captureException(err);
3937
});
4038
});

0 commit comments

Comments
 (0)