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
Copy file name to clipboardExpand all lines: docs/platforms/python/configuration/draining.mdx
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,7 @@ sidebar_order: 80
4
4
description: "Learn more about the default behavior of our SDK if the application shuts down unexpectedly."
5
5
---
6
6
7
-
The default behavior of most SDKs is to send out events over the network
8
-
asynchronously in the background. This means that some events might be lost if the application shuts down unexpectedly. The SDKs provide mechanisms to cope with this.
7
+
By default the SDK sends out events over the network on a background thread. This means that some events might be lost if the application shuts down unexpectedly. The SDK provides mechanisms to cope with this.
9
8
10
9
The Python SDK automatically drains on shutdown unless the `AtexitIntegration` is removed or the `shutdown_timeout`
11
10
config key is set to 0. If you need to manually drain, the client provides a `close` method:
Copy file name to clipboardExpand all lines: docs/platforms/python/configuration/draining__v1.x.mdx
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,7 @@ sidebar_order: 80
4
4
description: "Learn more about the default behavior of our SDK if the application shuts down unexpectedly."
5
5
---
6
6
7
-
The default behavior of most SDKs is to send out events over the network
8
-
asynchronously in the background. This means that some events might be lost if the application shuts down unexpectedly. The SDKs provide mechanisms to cope with this.
7
+
By default the SDK sends out events over the network on a background thread. This means that some events might be lost if the application shuts down unexpectedly. The SDK provides mechanisms to cope with this.
9
8
10
9
The Python SDK automatically drains on shutdown unless the `AtexitIntegration` is removed or the `shutdown_timeout`
11
10
config key is set to 0. To manually drain the client provides a `close` method:
When the SDK creates an event or breadcrumb for transmission, that transmission is typically created from some sort of source object. For instance, an error event is typically created from a log record or exception instance. For better customization, SDKs send these objects to certain callbacks (<PlatformIdentifiername="before-send" />, <PlatformIdentifiername="before-breadcrumb" /> or the event processor system in the SDK).
65
+
When the SDK creates an event or breadcrumb for transmission, that transmission is typically created from some sort of source object. For instance, an error event is typically created from a log record or exception instance. For better customization, the SDK sends these objects to certain callbacks (<PlatformIdentifiername="before-send" />, <PlatformIdentifiername="before-breadcrumb" /> and event processors).
66
66
67
67
### Using Hints
68
68
@@ -75,7 +75,7 @@ Event and breadcrumb `hints` are objects containing various information used to
75
75
76
76
For events, hints contain properties such as `event_id`, `originalException`, `syntheticException` (used internally to generate cleaner stack trace), and any other arbitrary `data` that you attach.
77
77
78
-
For breadcrumbs, the use of `hints`is implementation dependent. For XHR requests, the hint contains the xhr object itself; for user interactions the hint contains the DOM element and event name and so forth.
78
+
For breadcrumbs, the use of `hints`depends on the type of breadcrumb. For logs, the hint contains the original `logging` log record.
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.
243
+
This function is called with the event payload, and can return a modified event object, or `None` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending.
244
244
245
245
By the time `before_send` is executed, all scope data has already been applied to the event. Further modification of the scope won't have any effect.
This function is called with an SDK-specific transaction event object, and can return a modified transaction event object, or `null` to skip reporting the event. One way this might be used is for manual PII stripping before sending.
251
+
This function is called with a transaction event object, and can return a modified transaction event object, or `None` to skip reporting the event. One way this might be used is for manual PII stripping before sending.
This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When nothing is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object.
257
+
This function is called with a breadcrumb object before the breadcrumb is added to the scope. When nothing is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object.
258
258
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like.
259
259
260
260
</SdkOption>
@@ -277,7 +277,7 @@ Transports are used to send events to Sentry. Transports can be customized to so
Switches out the transport used to send events. How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication.
280
+
Switches out the transport used to send events. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication.
281
281
282
282
</SdkOption>
283
283
@@ -313,7 +313,7 @@ A dict containing additional proxy headers (usually for authentication) to be fo
Controls how many seconds to wait before shutting down. Sentry SDKs send events from a background queue. This queue is given a certain amount to drain pending events. The default is SDK specific but typically around two seconds. Setting this value too low may cause problems for sending events from command line applications. Setting the value too high will cause the application to block for a long time for users experiencing network connectivity problems.
316
+
Controls how many seconds to wait before shutting down. The SDK sends events from a background queue. This queue is given a certain amount to drain pending events. Setting this value too low may cause problems for sending events from command line applications. Setting the value too high will cause the application to block for a long time for users experiencing network connectivity problems.
Copy file name to clipboardExpand all lines: docs/platforms/python/configuration/sampling.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ By default, none of these options are set, meaning no transactions will be sent
75
75
76
76
### Default Sampling Context Data
77
77
78
-
The information contained in the <PlatformIdentifiername="sampling-context" /> object passed to the <PlatformIdentifiername="traces-sampler" /> when a transaction is created varies by platform and integration.
78
+
The information contained in the <PlatformIdentifiername="sampling-context" /> object passed to the <PlatformIdentifiername="traces-sampler" /> when a transaction is created varies by integration.
Copy file name to clipboardExpand all lines: docs/platforms/python/configuration/sessions.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ sidebar_order: 50
4
4
description: "Learn how to configure your SDK to tell Sentry about users sessions."
5
5
---
6
6
7
-
A session represents the interaction between the user and the application. Sessions contain a timestamp, a status (if the session was OK or if it crashed), and are always linked to a release. Most Sentry SDKs can manage sessions automatically.
7
+
A session represents the interaction between the user and the application. Sessions contain a timestamp, a status (if the session was OK or if it crashed), and are always linked to a release. The SDK manages sessions automatically on <PlatformLinkto="/integrations/#web-frameworks">supported web frameworks</PlatformLink>.
Copy file name to clipboardExpand all lines: docs/platforms/python/data-management/sensitive-data/index.mdx
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,21 +19,19 @@ These are some great examples for data scrubbing that every company should think
19
19
20
20
We offer the following options depending on your legal and operational needs:
21
21
22
-
- filtering or scrubbing sensitive data within the SDK, so that data is _not sent to_ Sentry. Different SDKs have different capabilities, and configuration changes require a redeployment of your application.
22
+
- filtering or scrubbing sensitive data within the SDK, so that data is _not sent to_ Sentry. Configuration changes require a redeployment of your application.
23
23
-[configuring server-side scrubbing](/security-legal-pii/scrubbing/server-side-scrubbing/) to ensure Sentry does _not store_ data. Configuration changes are done in the Sentry UI and apply immediately for new events.
24
24
-[running a local Relay](/product/relay/) on your own server between the SDK and Sentry, so that data is _not sent to_ Sentry while configuration can still be applied without deploying.
25
25
26
26
<Alert>
27
27
28
28
Ensure that your team is aware of your company's policy around what can and cannot be sent to Sentry. We recommend determining this policy early in your implementation and communicating it as well as enforcing it via code review.
29
29
30
-
If you are using Sentry in your mobile app, read our [frequently asked questions about mobile data privacy](/security-legal-pii/security/mobile-privacy/) to assist with Apple App Store and Google Play app privacy details.
31
-
32
30
</Alert>
33
31
34
32
## Personally Identifiable Information (PII)
35
33
36
-
Our newer SDKs do not purposefully send PII to stay on the safe side. This behavior is controlled by an option called [`send-default-pii`](../../configuration/options/#send-default-pii).
34
+
The SDK purposefully does not send PII to stay on the safe side. This behavior is controlled by an option called [`send-default-pii`](../../configuration/options/#send-default-pii).
37
35
38
36
Turning this option on is required for certain features in Sentry to work, but also means you will need to be even more careful about what data is being sent to Sentry (using the options below).
39
37
@@ -49,18 +47,18 @@ You can use the <PlatformIdentifier name="event-scrubber" /> configuration param
SDKs provide a <PlatformIdentifiername="before-send" /> hook, which is invoked before an error or message event is sent and can be used to modify event data to remove sensitive information. Some SDKs also provide a <PlatformIdentifiername="before-send-transaction" /> hook which does the same thing for transactions. We recommend using <PlatformIdentifiername="before-send" /> and <PlatformIdentifiername="before-send-transaction" /> in the SDKs to **scrub any data before it is sent**, to ensure that sensitive data never leaves the local environment.
50
+
The SDK provides a <PlatformIdentifiername="before-send" /> hook, which is invoked before an error or message event is sent and can be used to modify event data to remove sensitive information. The SDK also provide a <PlatformIdentifiername="before-send-transaction" /> hook which does the same thing for transactions. We recommend using <PlatformIdentifiername="before-send" /> and <PlatformIdentifiername="before-send-transaction" /> in the SDK to **scrub any data before it is sent**, to ensure that sensitive data never leaves the local environment.
- Stack-locals → Some SDKs (Python, PHP and Node) will pick up variable values within the stack trace. 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. Most SDKs will add the HTTP query string and fragment as a data attribute to the breadcrumb, which may need to be scrubbed.
56
+
- Stack-locals → The SDK picks up variable values within the stack trace. These can be scrubbed, or this behavior can be disabled altogether if necessary.
57
+
- Breadcrumbs → The SDK picks up previously executed log statements. **Do not log PII** if using this feature and including log statements as breadcrumbs in the event. The SDK will also record database queries, which may need to be scrubbed. The SDK will add the HTTP query string and fragment as a data attribute to the breadcrumb, which may need to be scrubbed.
60
58
- User context → Automated behavior is controlled via <PlatformIdentifiername="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.
63
-
- HTTP Spans → Most SDKs will include the HTTP query string and fragment as a data attribute, which means the HTTP span may need to be scrubbed.
59
+
- HTTP context → Query strings are picked up in web frameworks as part of the HTTP request context.
60
+
- Transaction Names → In certain situations, transaction names might contain sensitive data. For example, an HTTP request 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 SDK can parameterize URLs and routes successfully, that is, turn `/users/1234/details` into `/users/:userid/details`. However, depending on the web framework, your routing configuration, and a few other factors, the SDKs might not be able to completely parameterize all of your URLs.
61
+
- HTTP Spans → The SDK includes the HTTP query string and fragment as a data attribute, which means the HTTP span may need to be scrubbed.
64
62
65
63
For more details and data filtering instructions, see <PlatformLinkto="/configuration/filtering/">Filtering Events</PlatformLink>.
66
64
@@ -88,4 +86,4 @@ As a best practice you should always avoid logging confidential information. If
88
86
89
87
- Anonymize the confidential information within the log statements (for example, swap out email addresses -> for internal identifiers)
90
88
- Use <PlatformIdentifiername="before-breadcrumb" /> to filter it out from breadcrumbs before it is attached
91
-
-Disable logging breadcrumb integration (for example, as described [here](/platforms/javascript/configuration/integrations/breadcrumbs/))
89
+
-Set the `level` parameter in the <PlatformLinkto="/integrations/#logging">logging integrations</PlatformLink> you use to `None`.
The available breadcrumb keys are `type`, `category`, `message`, `level`, `timestamp` (which many SDKs will set automatically for you), and `data`, which is the place to put any additional information you'd like the breadcrumb to include. Using keys other than these six won't cause an error, but will result in the data being dropped when the event is processed by Sentry.
24
+
The available breadcrumb keys are `type`, `category`, `message`, `level`, `timestamp` (which defaults to the system's wall-clock time), and `data`, which is the place to put any additional information you'd like the breadcrumb to include. Using keys other than these six won't cause an error, but will result in the data being dropped when the event is processed by Sentry.
25
25
26
26
## Automatic Breadcrumbs
27
27
@@ -31,7 +31,7 @@ The available breadcrumb keys are `type`, `category`, `message`, `level`, `times
31
31
32
32
SDKs allow you to customize breadcrumbs through the <PlatformIdentifiername="before-breadcrumb" /> hook.
33
33
34
-
This hook is passed an already assembled breadcrumb and, in some SDKs, an optional hint. The function can modify the breadcrumb or decide to discard it entirely by returning `null`:
34
+
This hook is passed an already assembled breadcrumb and <PlatformLinkto="/configuration/filtering/#using-hints">a `hint` object</PlatformLink> containing extra metadata. The function can modify the breadcrumb or decide to discard it entirely by returning `None`:
Copy file name to clipboardExpand all lines: docs/platforms/python/enriching-events/context/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Learn more about conventions for common contexts in the [contexts interface deve
29
29
30
30
When sending context, _consider payload size limits_. Sentry does not recommend sending the entire application state and large data blobs in contexts. If you exceed the maximum payload size, Sentry will respond with HTTP error `413 Payload Too Large` and reject the event.
31
31
32
-
The Sentry SDK will try its best to accommodate the data you send and trim large context payloads. Some SDKs can truncate parts of the event; for more details, see the [developer documentation on SDK data handling](https://develop.sentry.dev/sdk/expected-features/data-handling/).
32
+
The Sentry SDK will try its best to accommodate the data you send and trim large context payloads. The SDK can truncate parts of the event; for more details, see the [developer documentation on SDK data handling](https://develop.sentry.dev/sdk/expected-features/data-handling/).
Copy file name to clipboardExpand all lines: docs/platforms/python/enriching-events/identify-user/index.mdx
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,9 @@ An alternative, or addition, to the username. Sentry is aware of email addresses
22
22
### `ip_address`
23
23
24
24
The user's IP address. If the user is unauthenticated, Sentry uses the IP address as a unique identifier for the user.
25
-
Serverside SDKs that instrument incoming requests will attempt to pull the IP address from the HTTP request data (`request.env.REMOTE_ADDR` field in JSON), if available. That might require <PlatformIdentifiername="send-default-pii" /> set to `true` in the SDK options.
25
+
The SDK will attempt to pull the IP address from the HTTP request data on incoming requests (`request.env.REMOTE_ADDR` field in JSON), if available. That requires <PlatformIdentifiername="send-default-pii" /> set to `true` in the SDK options.
26
26
27
-
If the user's `ip_address` is set to `"{{auto}}"`, Sentry will infer the IP address from the connection between your app and Sentry's server.
28
-
29
-
If the field is omitted, the default value is `null`. However, due to backwards compatibility concerns, certain platforms (in particular JavaScript) have a different default value for `"{{auto}}"`. SDKs and other clients should not rely on this behavior and should set IP addresses or `"{{auto}}"` explicitly.
27
+
If the user's `ip_address` is set to `"{{auto}}"`, Sentry will infer the IP address from the connection between your app and Sentry's server. If the field is omitted, the default value is `None`.
30
28
31
29
To opt out of storing users' IP addresses 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](/security-legal-pii/scrubbing/) scrubbing to remove `$user.ip_address`. Adding such a rule ultimately overrules any other logic.
0 commit comments