You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Event processors added via `Sentry.addEventProcessor()` will be applied to all events in your current request.
121
-
If you want to add an event processor that only applies to certain events, you can also add one to a scope as follows:
122
+
123
+
If you want to add an event processor that only applies to certain events, you can also add one to a scope as follows:
124
+
122
125
</PlatformCategorySection>
123
126
124
127
```javascript
@@ -136,6 +139,7 @@ Sentry.withScope((scope) => {
136
139
`beforeSend` and `beforeSendTransaction` are guaranteed to be run last, after all other event processors, (which means they get the final version of the event right before it's sent, hence the name). Event processors added with `addEventProcessor` are run in an undetermined order, which means changes to the event may still be made after the event processor runs.
137
140
138
141
There can only be a single `beforeSend` / `beforeSendTransaction` processor, but you can add multiple event processors via `addEventProcessor()`.
142
+
139
143
</Expandable>
140
144
</SdkApi>
141
145
@@ -322,7 +326,30 @@ Messages show up as issues on your issue stream, with the message as the issue n
Set a context to be sent with Sentry events. Custom contexts allow you to attach arbitrary data to an event.
330
+
You cannot search these, but they are viewable on the issue page - if you
331
+
need to be able to filter for certain data, use [tags](./#setTag) instead.
332
+
333
+
There are no restrictions on context name. In the context object, all keys are allowed except for `type`, which is used internally.
334
+
335
+
By default, Sentry SDKs normalize nested structured context data up to three levels deep.
336
+
Any data beyond this depth will be trimmed and marked using its type instead.
337
+
To adjust this default, use the <PlatformLinkto="/configuration/options#normalize-depth">`normalizeDepth`</PlatformLink> SDK option.
338
+
339
+
Learn more about conventions for common contexts in the [contexts interface developer documentation](https://develop.sentry.dev/sdk/data-model/event-payloads/contexts/).
340
+
341
+
<Expandabletitle='Example'>
342
+
Context data is structured and can contain any data you want:
343
+
344
+
```javascript
345
+
Sentry.setContext("character", {
346
+
name:"Mighty Fighter",
347
+
age:19,
348
+
attack_type:"melee",
349
+
});
350
+
```
351
+
</Expandable>
352
+
326
353
</SdkApi>
327
354
328
355
<SdkApi
@@ -350,16 +377,70 @@ Messages show up as issues on your issue stream, with the message as the issue n
350
377
type: {
351
378
name: "User",
352
379
properties: [
353
-
{ name: "id", type: "string | number" },
354
-
{ name: "email", type: "string" },
355
-
{ name: "ip_address", type: "string" },
356
-
{ name: "username", type: "string" },
380
+
{
381
+
name: "id",
382
+
type: "string | number",
383
+
description: "Your internal identifier for the user",
384
+
},
385
+
{
386
+
name: "email",
387
+
type: "string",
388
+
description:
389
+
"Sentry is aware of email addresses and can display things such as Gravatars and unlock messaging capabilities",
390
+
},
391
+
{
392
+
name: "username",
393
+
type: "string",
394
+
description:
395
+
"Typically used as a better label than the internal id",
396
+
},
397
+
{
398
+
name: "ip_address",
399
+
type: "string",
400
+
description:
401
+
"The user's IP address. If the user is unauthenticated, Sentry uses the IP address as a unique identifier for the user",
402
+
},
357
403
],
358
404
},
359
405
},
360
406
]}
361
407
>
362
-
Set a user to be sent with Sentry events. Set to `null` to unset the user.
408
+
Set a user to be sent with Sentry events. Set to `null` to unset the user. In
409
+
addition to the specified properties of the `User` object, you can also add
On the server, the IP address will be inferred from the incoming HTTP request, if available.
415
+
This is automatically done if you have configured `sendDefaultPii: true` in your <PlatformLinkto="/configuration/options/#sendDefaultPii">SDK configuration</PlatformLink>.
416
+
</PlatformCategorySection>
417
+
418
+
<PlatformCategorySectionsupported={["browser"]}>
419
+
On the browser, if the users' `ip_address` is set to `"{{ auto }}"`, Sentry
420
+
will infer the IP address from the connection between your app and Sentrys'
421
+
server. `{{auto}}` is automatically set if you have configured `sendDefaultPii:
422
+
true` in your <PlatformLinkto="/configuration/options/#sendDefaultPii">SDK configuration</PlatformLink>.
423
+
</PlatformCategorySection>
424
+
425
+
To ensure your users' IP addresses are never stored in your event data, you can go to your project settings, click on "Security & Privacy", and enable "Prevent Storing of IP Addresses" or use Sentry's [server-side data scrubbing](/security-legal-pii/scrubbing/) to remove `$user.ip_address`. Adding such a rule ultimately overrules any other logic.
426
+
427
+
</Expandable>
428
+
429
+
430
+
<PlatformCategorySectionsupported={["server"]}>
431
+
<Expandabletitle="Setting The User For the Current Request ">
`Sentry.setUser()` will set the user for the currently active request - see <PlatformLinkto="/enriching-events/request-isolation">Request Isolation</PlatformLink> for more information. For example, if you want to set the user for a single request, you can do this like this:
The DSN tells the SDK where to send the events. If this is not set, the SDK will not send any events. Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization).
This variable controls the total amount of breadcrumbs that should be captured. You should be aware that Sentry has a [maximum payload size](https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits) and any events exceeding that payload size will be dropped.
@@ -305,8 +311,9 @@ When enabled, all props of the Vue component where the error was thrown in are a
305
311
to capture Vue exceptions and report them to Sentry.
306
312
When `attachErrorHandler` is set to `false`, automatic error reporting is disabled.
307
313
308
-
Usually, this option should stay enabled, unless you want to set up Sentry error reporting yourself.
309
-
For example, the Sentry Nuxt SDK does not attach an error handler as it's capturing errors through the error hooks provided by Nuxt.
314
+
Usually, this option should stay enabled, unless you want to set up Sentry error reporting yourself.
315
+
For example, the Sentry Nuxt SDK does not attach an error handler as it's capturing errors through the error hooks provided by Nuxt.
0 commit comments