Skip to content

Commit bf4d4c1

Browse files
authored
fix(various): Small formatting and language fixes (#5813)
This is a bunch of small fixes and tweaks extracted from my work adding `beforeSendTransaction` to the docs - autoformatting, proofreading, and the occasional clarification.
1 parent 3d19f5d commit bf4d4c1

File tree

11 files changed

+70
-70
lines changed

11 files changed

+70
-70
lines changed

src/docs/product/accounts/quotas/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To see which of your projects are using up your quota, you can review the "Usage
1515

1616
You can also download a project breakdown report in the "Usage History" tab of **Settings > Subscriptions** (only accessible to Owner and Billing members of your Sentry organization).
1717

18-
Sentrys flexibility means you can exercise fine-grained control over which events and attachments count toward your quota. This page provides you with high-level information about strategies for managing your quota, but you can get more detailed information in:
18+
Sentry's flexibility means you can exercise fine-grained control over which events and attachments count toward your quota. This page provides you with high-level information about strategies for managing your quota, but you can get more detailed information in:
1919

2020
- [Manage Your Error Quota](/product/accounts/quotas/manage-event-stream-guide/)
2121
- [Manage Your Transaction Quota](/product/accounts/quotas/manage-transaction-quota/)
@@ -43,7 +43,7 @@ This list of strategies for managing your quota is ordered from easiest or least
4343

4444
## Key Terms
4545

46-
Lets clarify a few terms to start:
46+
Let's clarify a few terms to start:
4747

4848
- **Event** - An event is one instance of you sending data to Sentry, excluding attachments. Generally, this data is an error or a transaction.
4949
- **Error** - What counts as an error varies by platform, but in general, if there's something that looks like an exception, it can be captured as an error in Sentry. Sentry automatically captures errors, uncaught exceptions, and unhandled rejections, as well as other types of errors, depending on platform. A grouping of similar errors makes [an issue](/product/issues/).

src/docs/product/accounts/quotas/manage-event-stream-guide.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ You can find a list of deleted and discarded issues in the "Discarded Issues" ta
274274

275275
![List of Discarded Issues](manage-event-stream-07-new.png)
276276

277-
Once you've identified a set of discarded issues, it might make sense to go back to your SDK configuration and add the related errors into your `before-send` client-side filtering.
277+
Once you've identified a set of discarded issues, it might make sense to go back to your SDK configuration and add the related errors into your `beforeSend` client-side filtering.
278278

279279
## 5. Inbound Data Filters {#3-inbound-data-filters}
280280

src/docs/product/relay/index.mdx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,15 @@ Sentry already scrubs PII in two places:
3232
1. In the SDK before sending the event
3333
2. Upon arrival on Sentry's infrastructure
3434

35-
Relay adds a third option that scrubs data in a central place prior to sending
36-
it to Sentry.
35+
Relay adds a third option that scrubs data in a central place prior to sending it to Sentry.
3736

3837
To choose the right place for data scrubbing, consider:
3938

40-
- If you prefer to configure data scrubbing in a central place, you can let
41-
Sentry handle data scrubbing. Upon arrival, Sentry immediately applies
42-
[server-side scrubbing](/product/data-management-settings/scrubbing/server-side-scrubbing/) and guarantees that personal information is never
43-
stored.
39+
- If you prefer to configure data scrubbing in a central place, you can let Sentry handle it. When an event arrives, Sentry will immediately apply [server-side scrubbing](/product/data-management-settings/scrubbing/server-side-scrubbing/), guaranteeing that personal information won't ever be stored.
4440

45-
- If you cannot send PII outside your infrastructure, but you still prefer to
46-
configure data scrubbing in a centralized place, configure your SDK to send events to Relay. Relay uses the privacy settings configured in Sentry, and scrubs PII before forwarding data to Sentry.
41+
- If you can't send PII outside your infrastructure, but still prefer to configure data scrubbing in a centralized place, configure your SDK to send events to Relay, which uses the privacy settings configured in Sentry, and scrubs PII before forwarding any data.
4742

48-
- If you must enforce strict data privacy requirements, you can configure SDKs to
49-
scrub PII using the [`before-send` hooks](/platform-redirect/?next=/configuration/options/%23hooks), which prevents data from being
50-
collected on the device. This may require you to replicate the same logic across
51-
your applications, and may impact performance.
43+
- If you must enforce strict data privacy requirements, you can configure SDKs to scrub PII using the [`beforeSend` hook](/platform-redirect/?next=/configuration/options/%23hooks), which prevents data from being collected on the device. This may require you to replicate the same logic across your applications, and may impact performance.
5244

5345
### Response Time
5446

src/platform-includes/configuration/decluttering/javascript.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@ You can construct an allowed list of domains which might raise acceptable except
22

33
```javascript
44
Sentry.init({
5-
allowUrls: [
6-
/https?:\/\/((cdn|www)\.)?example\.com/
7-
]
5+
allowUrls: [/https?:\/\/((cdn|www)\.)?example\.com/],
86
});
97
```
108

119
You can also use `denyUrls` if you want to block specific URLs forever.
1210

1311
<Alert level="warning" title="Note">
1412

15-
Previously, `allowUrls` and `denyUrls` were called `whitelistUrls` and `blacklistUrls` respectively. These options are removed in version 7.0. For more information, please see our [Inclusive Language Policy](https://develop.sentry.dev/inclusion/).
13+
Previously, `allowUrls` and `denyUrls` were called `whitelistUrls` and `blacklistUrls`, respectively. These options were removed in version 7.0. For more information, please see our [Inclusive Language Policy](https://develop.sentry.dev/inclusion/).
1614

1715
</Alert>
1816

src/platforms/common/configuration/options.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ thread-safe APIs and only use Unity-specific APIs after you've checked that you'
559559

560560
<ConfigKey name="before-send">
561561

562-
This function is called with an SDK-specific event object, and can return a modified event object or nothing to skip reporting the event. This can be used, for instance, for manual PII stripping before sending.
562+
This function is called with an SDK-specific message or error event object, and can return a modified event object, or `null` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending.
563563

564564
</ConfigKey>
565565

src/platforms/common/data-management/sensitive-data/index.mdx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,13 @@ SDKs provide a <PlatformIdentifier name="before-send" /> hook, which is invoked
5353

5454
<PlatformContent includePath="configuration/before-send" />
5555

56-
There's a few areas you should consider that sensitive data may appear:
57-
58-
- Stack-locals → some SDKs (Python + PHP), will pick up variable values within the stacktrace. This can be scrubbed or disabled altogether, if necessary
59-
- Breadcrumbs → some SDKs (for example, JavaScript, Java logging integrations) will pick up previously executed log statements. **Do not log PII** if using this feature and including log statements as breadcrumbs in the event. Some backend SDKs will surface DB queries which may need to be scrubbed
60-
- User context → automated behavior is controlled via `send-default-pii`
61-
- HTTP context → query strings may be picked up in some frameworks as part of the HTTP request context
62-
- Transaction Names → In certain situations, transaction names might contain sensitive data.
63-
For example, a browser's pageload transaction might have a raw URL like `/users/1234/details` as its name (where `1234` is a user id, which may be considered PII).
64-
In most cases, our SDKs can parameterize URLs and routes successfully, that is, turn `/users/1234/details` into `/users/:userid/details`.
65-
However, depending on the framework you use, your routing configurations, timings, and a few other factors, the SDKs might not be able to
66-
completely parameterize all your URLs.
56+
Sensitive data may appear in the following areas:
57+
58+
- Stack-locals → Some SDKs (Python and PHP) will pick up variable values within the stacktrace. These can be scrubbed, or this behavior can be disabled altogether if necessary.
59+
- Breadcrumbs → Some SDKs (JavaScript and the Java logging integrations, for example) will pick up previously executed log statements. **Do not log PII** if using this feature and including log statements as breadcrumbs in the event. Some backend SDKs will also record database queries, which may need to be scrubbed.
60+
- User context → Automated behavior is controlled via `send-default-pii`.
61+
- HTTP context → Query strings may be picked up in some frameworks as part of the HTTP request context.
62+
- Transaction Names → In certain situations, transaction names might contain sensitive data. For example, a browser's pageload transaction might have a raw URL like `/users/1234/details` as its name (where `1234` is a user id, which may be considered PII). In most cases, our SDKs can parameterize URLs and routes successfully, that is, turn `/users/1234/details` into `/users/:userid/details`. However, depending on the framework, your routing configuration, race conditions, and a few other factors, the SDKs might not be able to completely parameterize all of your URLs.
6763

6864
For more details and data filtering instructions, see <PlatformLink to="/configuration/filtering/">Filtering Events</PlatformLink>.
6965

src/platforms/common/enriching-events/user-feedback.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The user feedback API provides the ability to collect user information when an e
2828

2929
<PlatformSection notSupported={["unreal"]}>
3030

31-
Sentry pairs the feedback with the original event, giving you additional insight into issues. Sentry needs the `eventId` to be able to associate the user feedback to the corresponding event. To get the `eventId`, for example, you can use the <PlatformLink to="/configuration/options/#before-send"><PlatformIdentifier name="before-send" /></PlatformLink>, or the return value of the methods capturing an event.
31+
Sentry pairs the feedback with the original event, giving you additional insight into issues. Sentry needs the `eventId` to be able to associate the user feedback to the corresponding event. For example, to get the `eventId`, you can use <PlatformLink to="/configuration/options/#before-send"><PlatformIdentifier name="before-send" /></PlatformLink> or the return value of the method capturing an event.
3232

3333
</PlatformSection>
3434

src/platforms/javascript/common/configuration/integrations/plugin.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ This integration captures all `Console API` calls and redirects them to Sentry u
4242

4343
_Import name: `Sentry.Integrations.Debug`_
4444

45-
This integration allows you to inspect the content of the processed event that will be passed to `beforeSend`, and effectively send it to the Sentry SDK. It will *always* run as the last integration, no matter when it was registered.
45+
This integration allows you to inspect the contents of the processed event and `hint` object that will be passed to `beforeSend`. It will _always_ run as the last integration, no matter when it was registered.
46+
47+
Note that this is different than setting `debug: true` in your `Sentry.init` options, which will enable debug logging in the console.
4648

4749
Available options:
4850

src/platforms/javascript/common/troubleshooting/index.mdx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,12 @@ This also helps to prevent tracking of any parent application errors in case you
266266
inside of it. In this example we use `@sentry/browser` but it's also applicable to `@sentry/node`.
267267

268268
```javascript
269-
import { BrowserClient, defaultStackParser, defaultIntegrations, makeFetchTransport } from "@sentry/browser";
269+
import {
270+
BrowserClient,
271+
defaultStackParser,
272+
defaultIntegrations,
273+
makeFetchTransport,
274+
} from "@sentry/browser";
270275

271276
const client = new BrowserClient({
272277
dsn: "___PUBLIC_DSN___",
@@ -281,7 +286,12 @@ client.captureException(new Error("example"));
281286
While the above sample should work perfectly fine, some methods like `configureScope` and `withScope` are missing on the `Client` because the `Hub` takes care of the state management. That's why it may be easier to create a new `Hub` and bind your `Client` to it. The result is the same but you will also get state management with it.
282287

283288
```javascript
284-
import { BrowserClient, defaultStackParser, defaultIntegrations, makeFetchTransport } from "@sentry/browser";
289+
import {
290+
BrowserClient,
291+
defaultStackParser,
292+
defaultIntegrations,
293+
makeFetchTransport,
294+
} from "@sentry/browser";
285295

286296
const client = new BrowserClient({
287297
dsn: "___PUBLIC_DSN___",
@@ -311,7 +321,7 @@ hub.withScope(function(scope) {
311321
});
312322
```
313323

314-
### Dealing with integrations
324+
### Dealing with Integrations
315325

316326
Integrations are setup on the `Client`, if you need to deal with multiple clients and hubs you have to make sure to also do the integration handling correctly.
317327
Here is a working example of how to use multiple clients with multiple hubs running global integrations.
@@ -346,7 +356,7 @@ const client1 = new Sentry.BrowserClient({
346356
integrations: [...Sentry.defaultIntegrations, new HappyIntegration()],
347357
beforeSend(event) {
348358
console.log("client 1", event);
349-
return null; // Returning null does not send the event
359+
return null; // Returning `null` prevents the event from being sent
350360
},
351361
});
352362
const hub1 = new Sentry.Hub(client1);
@@ -358,21 +368,21 @@ const client2 = new Sentry.BrowserClient({
358368
integrations: [...Sentry.defaultIntegrations, new HappyIntegration()],
359369
beforeSend(event) {
360370
console.log("client 2", event);
361-
return null; // Returning null does not send the event
371+
return null; // Returning `null` prevents the event from being sent
362372
},
363373
});
364374
const hub2 = new Sentry.Hub(client2);
365375

366376
hub1.run(currentHub => {
367-
// The hub.run method makes sure that Sentry.getCurrentHub() returns this hub during the callback
377+
// The `hub.run` method makes sure that `Sentry.getCurrentHub()` returns this hub during the callback
368378
currentHub.captureMessage("a");
369379
currentHub.configureScope(function(scope) {
370380
scope.setTag("a", "b");
371381
});
372382
});
373383

374384
hub2.run(currentHub => {
375-
// The hub.run method makes sure that Sentry.getCurrentHub() returns this hub during the callback
385+
// The `hub.run` method makes sure that `Sentry.getCurrentHub()` returns this hub during the callback
376386
currentHub.captureMessage("x");
377387
currentHub.configureScope(function(scope) {
378388
scope.setTag("c", "d");

src/platforms/javascript/guides/gatsby/index.mdx

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,64 +42,64 @@ module.exports = {
4242
{
4343
resolve: "@sentry/gatsby",
4444
},
45-
]
45+
],
4646
};
4747
```
4848

4949
Configure your `Sentry.init`:
5050

5151
```javascript {filename:sentry.config.js}
52-
import * as Sentry from '@sentry/gatsby';
52+
import * as Sentry from "@sentry/gatsby";
5353

5454
Sentry.init({
55-
dsn: "___PUBLIC_DSN___",
56-
tracesSampleRate: 1.0, // Adjust this value in production
57-
beforeSend(event) {
58-
// Modify the event here
59-
if (event.user) {
60-
// Don't send user's email address
61-
delete event.user.email;
62-
}
63-
return event;
64-
},
65-
// ...
55+
dsn: "___PUBLIC_DSN___",
56+
tracesSampleRate: 1.0, // Adjust this value in production
57+
beforeSend(event) {
58+
// Modify the event here
59+
if (event.user) {
60+
// Don't send user's email address
61+
delete event.user.email;
62+
}
63+
return event;
64+
},
65+
// ...
6666
});
6767
```
6868

6969
```typescript {filename:sentry.config.ts}
70-
import * as Sentry from '@sentry/gatsby';
70+
import * as Sentry from "@sentry/gatsby";
7171

7272
Sentry.init({
73-
dsn: "___PUBLIC_DSN___",
74-
tracesSampleRate: 1.0, // Adjust this value in production
75-
beforeSend(event) {
76-
// Modify the event here
77-
if (event.user) {
78-
// Don't send user's email address
79-
delete event.user.email;
80-
}
81-
return event;
82-
},
83-
// ...
73+
dsn: "___PUBLIC_DSN___",
74+
tracesSampleRate: 1.0, // Adjust this value in production
75+
beforeSend(event) {
76+
// Modify the event here
77+
if (event.user) {
78+
// Don't send user's email address
79+
delete event.user.email;
80+
}
81+
return event;
82+
},
83+
// ...
8484
});
8585
```
8686

8787
### Gatsby Plugin Configuration
8888

89-
Another alternative is to use Gatsby's [plugin configuration options](https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/using-a-plugin-in-your-site/#using-plugin-configuration-options). While this keeps the SDK options with the plugin definition, it doesn't support non-serializable options.
89+
Another alternative is to use Gatsby's [plugin configuration options](https://www.gatsbyjs.com/docs/how-to/plugins-and-themes/using-a-plugin-in-your-site/#using-plugin-configuration-options). While this keeps the SDK options with the plugin definition, it doesn't support non-serializable options like `integrations`, `transport`, `stackParser`,`beforeSend`, and `tracesSampler`.
9090

9191
```javascript {filename:gatsby-config.js}
9292
module.exports = {
93+
plugins: [
9394
{
9495
resolve: "@sentry/gatsby",
9596
options: {
9697
dsn: "___PUBLIC_DSN___",
9798
tracesSampleRate: 1.0, // Adjust this value in production
98-
// Cannot set `beforeSend`
99+
// Cannot set any non-serializable options
99100
},
100101
},
101-
102-
]
102+
],
103103
};
104104
```
105105

0 commit comments

Comments
 (0)