From 2bfc41bb63c03b657b7c259671c8ec42a7c41c69 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Tue, 30 Sep 2025 14:38:50 +0200 Subject: [PATCH 01/10] docs: Remove generic references from rust --- docs/platforms/rust/common/configuration/draining.mdx | 3 +-- docs/platforms/rust/common/configuration/filtering.mdx | 2 +- docs/platforms/rust/common/configuration/options.mdx | 4 ++-- .../rust/common/data-management/sensitive-data/index.mdx | 8 +++----- .../rust/common/enriching-events/context/index.mdx | 2 +- .../rust/common/enriching-events/identify-user/index.mdx | 6 ++---- .../rust/common/enriching-events/scopes/index.mdx | 5 ++--- 7 files changed, 12 insertions(+), 18 deletions(-) diff --git a/docs/platforms/rust/common/configuration/draining.mdx b/docs/platforms/rust/common/configuration/draining.mdx index 7ed1a445a6f2a..82b66fbd487bd 100644 --- a/docs/platforms/rust/common/configuration/draining.mdx +++ b/docs/platforms/rust/common/configuration/draining.mdx @@ -4,7 +4,6 @@ sidebar_order: 70 description: "Learn more about the default behavior of our SDK if the application shuts down unexpectedly." --- -The default behavior of most SDKs is to send out events over the network -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. +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. diff --git a/docs/platforms/rust/common/configuration/filtering.mdx b/docs/platforms/rust/common/configuration/filtering.mdx index 433d3be7e89d0..c4b7ce11872bf 100644 --- a/docs/platforms/rust/common/configuration/filtering.mdx +++ b/docs/platforms/rust/common/configuration/filtering.mdx @@ -33,7 +33,7 @@ Event and breadcrumb `hints` are objects containing various information used to 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. -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. +For breadcrumbs, the use of `hints` depends on the type of breadcrumb. diff --git a/docs/platforms/rust/common/configuration/options.mdx b/docs/platforms/rust/common/configuration/options.mdx index 2a2224151005c..cdd407adf9d64 100644 --- a/docs/platforms/rust/common/configuration/options.mdx +++ b/docs/platforms/rust/common/configuration/options.mdx @@ -85,7 +85,7 @@ This option can be overridden using `in_app_include`. -This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When `None` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object. +This function is called with a breadcrumb object before the breadcrumb is added to the scope. When `None` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object. 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. @@ -107,7 +107,7 @@ The default value of `MaxRequestBodySize::Medium` will capture request bodies up - This function is called with an SDK-specific message or error event object, 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. +This function is called with the event payload, 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. 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. diff --git a/docs/platforms/rust/common/data-management/sensitive-data/index.mdx b/docs/platforms/rust/common/data-management/sensitive-data/index.mdx index f06150b89cbdd..b75989aa3be6b 100644 --- a/docs/platforms/rust/common/data-management/sensitive-data/index.mdx +++ b/docs/platforms/rust/common/data-management/sensitive-data/index.mdx @@ -19,7 +19,7 @@ These are some great examples for data scrubbing that every company should think We offer the following options depending on your legal and operational needs: -- 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. +- filtering or scrubbing sensitive data within the SDK, so that data is _not sent to_ Sentry. Configuration changes require a redeployment of your application. - [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. - [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. @@ -27,13 +27,11 @@ We offer the following options depending on your legal and operational needs: 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. -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. - ## Personally Identifiable Information (PII) -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). +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). 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). @@ -43,7 +41,7 @@ If you _do not_ wish to use the default PII behavior, you can also choose to ide ### & -SDKs provide a 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 hook which does the same thing for transactions. We recommend using and in the SDKs to **scrub any data before it is sent**, to ensure that sensitive data never leaves the local environment. +The SDK provides a 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 hook which does the same thing for transactions. We recommend using and in the SDK to **scrub any data before it is sent**, to ensure that sensitive data never leaves the local environment. diff --git a/docs/platforms/rust/common/enriching-events/context/index.mdx b/docs/platforms/rust/common/enriching-events/context/index.mdx index 36da3d54f7593..e71058c2634d2 100644 --- a/docs/platforms/rust/common/enriching-events/context/index.mdx +++ b/docs/platforms/rust/common/enriching-events/context/index.mdx @@ -29,7 +29,7 @@ Learn more about conventions for common contexts in the [contexts interface deve 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. -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/). +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/). ## Additional Data diff --git a/docs/platforms/rust/common/enriching-events/identify-user/index.mdx b/docs/platforms/rust/common/enriching-events/identify-user/index.mdx index aea73fd8ecb4c..b848a2756745a 100644 --- a/docs/platforms/rust/common/enriching-events/identify-user/index.mdx +++ b/docs/platforms/rust/common/enriching-events/identify-user/index.mdx @@ -22,11 +22,9 @@ An alternative, or addition, to the username. Sentry is aware of email addresses ### `ip_address` The user's IP address. If the user is unauthenticated, Sentry uses the IP address as a unique identifier for the user. -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 set to `true` in the SDK options. +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 set to `true` in the SDK options. -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 `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. +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 `null`. 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. diff --git a/docs/platforms/rust/common/enriching-events/scopes/index.mdx b/docs/platforms/rust/common/enriching-events/scopes/index.mdx index bcea42fa205bf..589448f3e95b1 100644 --- a/docs/platforms/rust/common/enriching-events/scopes/index.mdx +++ b/docs/platforms/rust/common/enriching-events/scopes/index.mdx @@ -1,11 +1,10 @@ --- title: Scopes and Hubs -description: "SDKs will typically automatically manage the scopes for you in the framework integrations. Learn what a scope is and how you can use it to your advantage." +description: "The SDK will in most cases automatically manage the scopes for you in the framework integrations. Learn what a scope is and how you can use it to your advantage." --- When an event is captured and sent to Sentry, SDKs will merge that event data with extra -information from the current scope. SDKs will typically automatically manage the scopes -for you in the framework integrations and you don't need to think about them. However, +information from the current scope. The SDK will in most cases automatically manage the scopes for you in the framework integrations and you don't need to think about them. However, you should know what a scope is and how you can use it for your advantage. ## What's a Scope, What's a Hub From b180268fcc16e4d4cd6c52870a81894f5973bd72 Mon Sep 17 00:00:00 2001 From: Lorenzo Cian <17258265+lcian@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:11:25 +0200 Subject: [PATCH 02/10] Update docs/platforms/rust/common/configuration/options.mdx --- docs/platforms/rust/common/configuration/options.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/rust/common/configuration/options.mdx b/docs/platforms/rust/common/configuration/options.mdx index cdd407adf9d64..f294613a14873 100644 --- a/docs/platforms/rust/common/configuration/options.mdx +++ b/docs/platforms/rust/common/configuration/options.mdx @@ -107,7 +107,7 @@ The default value of `MaxRequestBodySize::Medium` will capture request bodies up -This function is called with the event payload, 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. +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. 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. From a6e48533ab1456deaf9d505f5d57be4024fe08a0 Mon Sep 17 00:00:00 2001 From: Lorenzo Cian <17258265+lcian@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:11:34 +0200 Subject: [PATCH 03/10] Update docs/platforms/rust/common/configuration/options.mdx --- docs/platforms/rust/common/configuration/options.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/platforms/rust/common/configuration/options.mdx b/docs/platforms/rust/common/configuration/options.mdx index f294613a14873..7e9987b5f4b89 100644 --- a/docs/platforms/rust/common/configuration/options.mdx +++ b/docs/platforms/rust/common/configuration/options.mdx @@ -86,7 +86,6 @@ This option can be overridden using `in_app_include`. This function is called with a breadcrumb object before the breadcrumb is added to the scope. When `None` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object. -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. From 0c89bc8693cea60bc69ea4f0c18c50cd7e148f7b Mon Sep 17 00:00:00 2001 From: Lorenzo Cian <17258265+lcian@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:11:42 +0200 Subject: [PATCH 04/10] Update docs/platforms/rust/common/configuration/options.mdx --- docs/platforms/rust/common/configuration/options.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/rust/common/configuration/options.mdx b/docs/platforms/rust/common/configuration/options.mdx index 7e9987b5f4b89..ee41a15d8d1f1 100644 --- a/docs/platforms/rust/common/configuration/options.mdx +++ b/docs/platforms/rust/common/configuration/options.mdx @@ -85,7 +85,7 @@ This option can be overridden using `in_app_include`. -This function is called with a breadcrumb object before the breadcrumb is added to the scope. When `None` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object. +This function is called with a breadcrumb object before the breadcrumb is added to the scope. When `None` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the breadcrumb itself. From e85c7793ce9e4a63ac3ebd6f7d90b5b82cca8489 Mon Sep 17 00:00:00 2001 From: Lorenzo Cian <17258265+lcian@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:11:50 +0200 Subject: [PATCH 05/10] Update docs/platforms/rust/common/data-management/sensitive-data/index.mdx --- .../rust/common/data-management/sensitive-data/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/rust/common/data-management/sensitive-data/index.mdx b/docs/platforms/rust/common/data-management/sensitive-data/index.mdx index b75989aa3be6b..b95dd3dbf6e14 100644 --- a/docs/platforms/rust/common/data-management/sensitive-data/index.mdx +++ b/docs/platforms/rust/common/data-management/sensitive-data/index.mdx @@ -41,7 +41,7 @@ If you _do not_ wish to use the default PII behavior, you can also choose to ide ### & -The SDK provides a 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 hook which does the same thing for transactions. We recommend using and in the SDK to **scrub any data before it is sent**, to ensure that sensitive data never leaves the local environment. +The SDK provides a hook, which is invoked before an error or message event is sent and can be used to modify event data to remove sensitive information. We recommend using in the SDK to **scrub any data before it is sent**, to ensure that sensitive data never leaves the local environment. From 06c011652da3d8344e567d318608f302ffeffa7f Mon Sep 17 00:00:00 2001 From: Lorenzo Cian <17258265+lcian@users.noreply.github.com> Date: Tue, 30 Sep 2025 15:12:59 +0200 Subject: [PATCH 06/10] Update filtering.mdx --- .../rust/common/configuration/filtering.mdx | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/docs/platforms/rust/common/configuration/filtering.mdx b/docs/platforms/rust/common/configuration/filtering.mdx index c4b7ce11872bf..e1827708b6933 100644 --- a/docs/platforms/rust/common/configuration/filtering.mdx +++ b/docs/platforms/rust/common/configuration/filtering.mdx @@ -22,35 +22,8 @@ All Sentry SDKs support the callback m Note also that breadcrumbs can be filtered, as discussed in [our Breadcrumbs documentation](/product/error-monitoring/breadcrumbs/). -### Using Hints - -Hints are available in two places: - -1. / -2. `eventProcessors` - -Event and breadcrumb `hints` are objects containing various information used to put together an event or a breadcrumb. Typically `hints` hold the original exception so that additional data can be extracted or grouping can be affected. - -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. - -For breadcrumbs, the use of `hints` depends on the type of breadcrumb. - In this example, the fingerprint is forced to a common value if an exception of a certain type has been caught: - -#### Hints for Events - -`originalException` - -The original exception that caused the Sentry SDK to create the event. This is useful for changing how the Sentry SDK groups events or to extract additional information. - -`syntheticException` - -When a string or a non-error object is raised, Sentry creates a synthetic exception so you can get a basic stack trace. This exception is stored here for further data extraction. - -#### Hints for Breadcrumbs - - From 9c435e0b5a21e27f067a71a9d4510d85ed0ddff9 Mon Sep 17 00:00:00 2001 From: lcian <17258265+lcian@users.noreply.github.com> Date: Fri, 3 Oct 2025 16:33:11 +0200 Subject: [PATCH 07/10] add missing options --- .../rust/common/configuration/options.mdx | 86 ++++++++++++++++++- 1 file changed, 84 insertions(+), 2 deletions(-) diff --git a/docs/platforms/rust/common/configuration/options.mdx b/docs/platforms/rust/common/configuration/options.mdx index ee41a15d8d1f1..bc8c19e7a0fdf 100644 --- a/docs/platforms/rust/common/configuration/options.mdx +++ b/docs/platforms/rust/common/configuration/options.mdx @@ -83,6 +83,18 @@ This option can be overridden using `in_app_include`. + + +The server name to be reported. When not set, the server name is not sent with events. + + + + + +The user agent that should be reported when sending events to Sentry. + + + This function is called with a breadcrumb object before the breadcrumb is added to the scope. When `None` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the breadcrumb itself. @@ -91,11 +103,31 @@ This function is called with a breadcrumb object before the breadcrumb is added -This option controls the maximum size of request bodies that are sent to Sentry. +This option controls the maximum size of request bodies that are sent to Sentry by HTTP server integrations. The default value of `MaxRequestBodySize::Medium` will capture request bodies up to 10kB in size. + + + The timeout on client drop for draining events on shutdown. This controls how long the SDK will wait for pending events to be sent when shutting down. + + + + + + A list of integrations to enable. This allows you to manually pick and choose the integrations to enable. + By default, only the default integrations are enabled. + + + + + + Whether to add default integrations. When set to `false`, no default integrations will be added automatically. + The list of default integrations depends on the feature flags of the `sentry` crate that are active. + + + ## Error Monitoring Options @@ -121,6 +153,12 @@ A number between `0.0` and `1.0`, controlling the percentage chance a given tran + + +If given, called with a `SamplingContext` for each transaction to determine the sampling rate. Return a sample rate between `0.0` and `1.0` for the transaction in question. Takes priority over the `traces_sample_rate`. + + + ## Transport Options @@ -136,7 +174,51 @@ A number between `0.0` and `1.0`, controlling the percentage chance a given tran - + Setting this to `true` disables SSL certificate validation when sending outbound requests to Sentry. This should never be enabled when using the SDK in your real codebase or otherwise handling any kind of sensitive or personally identifiable information, as it could be exposed to potential attackers. + + + + The transport to use to send envelopes to Sentry. + This is typically either a boxed function taking the client options by reference and returning a `Transport`, a boxed `Arc` or alternatively the `DefaultTransportFactory`. + By default, the SDK uses a transport based on the `reqwest` crate running on a background thread. + + + +## Logging Options + +The following features and options are only available when the `logs` feature of the `sentry` crate is enabled. + + + +Determines whether captured structured logs should be sent to Sentry. + This option is only available when the `logs` feature is enabled. + + + + + + Callback that is executed for each Log being captured. When `None` is returned from the function, the log record is dropped. To pass the log record through, return the log record itself. + + This option is only available when the `logs` feature is enabled. + + + + +## Session Tracking Options + +The following features and options are only available when the `release-health` feature of the `sentry` crate is enabled. + + + +Enable Release Health Session tracking. When automatic session tracking is enabled, a new "user-mode" session is started at the time of `sentry::init`, and will persist for the application lifetime. + + + + + +Determine how Sessions are being tracked. Controls the mode for session tracking when `auto_session_tracking` is enabled. + + From 26258e1495a8ba19f0ebed3d57760518c4979968 Mon Sep 17 00:00:00 2001 From: lcian <17258265+lcian@users.noreply.github.com> Date: Fri, 3 Oct 2025 17:06:31 +0200 Subject: [PATCH 08/10] a bunch of other updates --- .../rust/common/configuration/filtering.mdx | 2 +- .../rust/common/configuration/releases.mdx | 32 ++++++++++++++++--- .../data-management/sensitive-data/index.mdx | 5 ++- .../enriching-events/breadcrumbs/index.mdx | 2 +- docs/platforms/rust/common/usage/index.mdx | 6 ++-- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/docs/platforms/rust/common/configuration/filtering.mdx b/docs/platforms/rust/common/configuration/filtering.mdx index e1827708b6933..e466dfedce1df 100644 --- a/docs/platforms/rust/common/configuration/filtering.mdx +++ b/docs/platforms/rust/common/configuration/filtering.mdx @@ -16,7 +16,7 @@ Configure your SDK to filter error events by using the -All Sentry SDKs support the callback method. Because it's called immediately before the event is sent to the server, this is your last chance to decide not to send data or to edit it. receives the event object as a parameter, which you can use to either modify the event’s data or drop it completely by returning `null`, based on custom logic and the data available on the event. +All Sentry SDKs support the callback method. Because it's called immediately before the event is sent to the server, this is your last chance to decide not to send data or to edit it. receives the event object as a parameter, which you can use to either modify the event’s data or drop it completely by returning `None`, based on custom logic and the data available on the event. diff --git a/docs/platforms/rust/common/configuration/releases.mdx b/docs/platforms/rust/common/configuration/releases.mdx index 7df4067795ec4..516e713bea987 100644 --- a/docs/platforms/rust/common/configuration/releases.mdx +++ b/docs/platforms/rust/common/configuration/releases.mdx @@ -13,11 +13,35 @@ A release is a version of your code that is deployed to an -## Setting a Release +## Setup + +To use the Release Health features, you need to activate the `release-health` feature flag of the `sentry` crate (enabled by default). +Additionally, you need to initialize the SDK by specifying additional options: + +```rust +use sentry; + +let _guard = sentry::init(("___PUBLIC_DSN___", sentry::ClientOptions { + // The `sentry::release_name` macro automatically infers the release from the cargo metadata, and is the preferred way to set the release + release: sentry::release_name!(), + // OR, manually: + // release: Some("my-project-name@2.3.12".into()), - + // Enables automatic session tracking, according to the configured `session_mode`. + // If the value of this option is set `false`, sessions need to be manually managed using `sentry::start_session` and `sentry::stop_session`. + auto_session_tracking: true, -How you make the release name (or version) available to your code is up to you. For example, you could use an environment variable that is set during the build process or during initial start-up. + // Sets the automatic session tracking mode. + // Possible values are `sentry::SessionMode::Application` and `sentry::SessionMode::Request`. + // `Application` should be used for user-attended programs, which typically have a single long running session that span the application's lifetime. + // `Request` should be used for servers, where each incoming request shall be considered as its own session. + session_mode: sentry::SessionMode::Application, + + ..Default::default() +})); +``` + +## Setting a Release Setting the release name tags each event with that release name. We recommend that you tell Sentry about a new release before sending events with that release name, as this will unlock a few more features. Learn more in our [Releases](/product/releases/) documentation. @@ -33,4 +57,4 @@ In order to monitor release health, the SDK sends session data. ### Sessions -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. +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. diff --git a/docs/platforms/rust/common/data-management/sensitive-data/index.mdx b/docs/platforms/rust/common/data-management/sensitive-data/index.mdx index b95dd3dbf6e14..1e9cf022cf141 100644 --- a/docs/platforms/rust/common/data-management/sensitive-data/index.mdx +++ b/docs/platforms/rust/common/data-management/sensitive-data/index.mdx @@ -47,8 +47,7 @@ The SDK provides a hook, which is invo Sensitive data may appear in the following areas: -- 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. -- 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. +- Breadcrumbs → The SDK can create breadcrumbs out of log events/records when using the `tracing` and `log` integrations. **Do not log PII** if using this feature and including log statements as breadcrumbs in the event. - User context → Automated behavior is controlled via . - HTTP context → Query strings may be picked up in some frameworks as part of the HTTP request context. - 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. @@ -80,4 +79,4 @@ As a best practice you should always avoid logging confidential information. If - Anonymize the confidential information within the log statements (for example, swap out email addresses -> for internal identifiers) - Use to filter it out from breadcrumbs before it is attached -- Disable logging breadcrumb integration (for example, as described [here](/platforms/javascript/configuration/integrations/breadcrumbs/)) +- Disable the integration that's creating breadcrumbs out of the logs diff --git a/docs/platforms/rust/common/enriching-events/breadcrumbs/index.mdx b/docs/platforms/rust/common/enriching-events/breadcrumbs/index.mdx index d61b0079f3b2d..4b77c8fbd90ef 100644 --- a/docs/platforms/rust/common/enriching-events/breadcrumbs/index.mdx +++ b/docs/platforms/rust/common/enriching-events/breadcrumbs/index.mdx @@ -23,4 +23,4 @@ Manually record a breadcrumb: ## Automatic Breadcrumbs - +Breadcrumbs are recorded automatically out of `TRACE` and `DEBUG` level events/records when using the integrations for the `tracing` and `log` crates respectively. diff --git a/docs/platforms/rust/common/usage/index.mdx b/docs/platforms/rust/common/usage/index.mdx index 59f7bda69588c..26d0ea53c9737 100644 --- a/docs/platforms/rust/common/usage/index.mdx +++ b/docs/platforms/rust/common/usage/index.mdx @@ -17,7 +17,7 @@ Key terms: -The most common form of capturing is to capture errors. What can be captured as an error varies by platform. In general, if you have something that looks like an exception, it can be captured. For some SDKs, you can also omit the argument to and Sentry will attempt to capture the current exception. It is also useful for manual reporting of errors or messages to Sentry. +The most common form of capturing is to capture errors. While capturing an event, you can also record the breadcrumbs that lead up to that event. Breadcrumbs are different from events: they will not create an event in Sentry, but will be buffered until the next event is sent. Learn more about breadcrumbs in our Breadcrumbs documentation. @@ -27,8 +27,10 @@ While capturing an event, you can also record the breadcrumbs that lead up to th ## Capturing Messages -Another common operation is to capture a bare message. A message is textual information that should be sent to Sentry. Typically, our SDKs don't automatically capture messages, but you can capture them manually. +Another common operation is to capture a bare message. A message is textual information that should be sent to Sentry. The SDK doesn't automatically capture messages, but you can capture them manually. Messages show up as issues on your issue stream, with the message as the issue name. + +The SDK can be initialized with the `attach_stacktrace` option set to `true` (default: `false`) to attach a stack trace to all events created out of `capture_message` calls. From 0630531854b7d1f854bd43a09cb2959c5af2637b Mon Sep 17 00:00:00 2001 From: Lorenzo Cian <17258265+lcian@users.noreply.github.com> Date: Fri, 3 Oct 2025 17:08:51 +0200 Subject: [PATCH 09/10] Update options.mdx --- docs/platforms/rust/common/configuration/options.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/rust/common/configuration/options.mdx b/docs/platforms/rust/common/configuration/options.mdx index bc8c19e7a0fdf..434756702a602 100644 --- a/docs/platforms/rust/common/configuration/options.mdx +++ b/docs/platforms/rust/common/configuration/options.mdx @@ -97,7 +97,7 @@ The user agent that should be reported when sending events to Sentry. -This function is called with a breadcrumb object before the breadcrumb is added to the scope. When `None` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the breadcrumb itself. +This function is called with a breadcrumb struct before the breadcrumb is added to the scope. When `None` is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the breadcrumb itself. @@ -138,7 +138,7 @@ The default value of `MaxRequestBodySize::Medium` will capture request bodies up -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. +This function is called with the event payload, and can return a modified event struct, or `None` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending. 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. From da731b4d41071ff2821743fd23ece7214a2f71a7 Mon Sep 17 00:00:00 2001 From: Lorenzo Cian <17258265+lcian@users.noreply.github.com> Date: Fri, 3 Oct 2025 17:12:36 +0200 Subject: [PATCH 10/10] Update options.mdx --- docs/platforms/rust/common/configuration/options.mdx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/platforms/rust/common/configuration/options.mdx b/docs/platforms/rust/common/configuration/options.mdx index 434756702a602..53c0bcf98036c 100644 --- a/docs/platforms/rust/common/configuration/options.mdx +++ b/docs/platforms/rust/common/configuration/options.mdx @@ -189,12 +189,11 @@ Setting this to `true` disables SSL certificate validation when sending outbound ## Logging Options -The following features and options are only available when the `logs` feature of the `sentry` crate is enabled. +The following features and options are only available when the `logs` feature of the `sentry` crate is enabled. This is not a default feature. Determines whether captured structured logs should be sent to Sentry. - This option is only available when the `logs` feature is enabled. @@ -202,14 +201,12 @@ Determines whether captured structured logs should be sent to Sentry. Callback that is executed for each Log being captured. When `None` is returned from the function, the log record is dropped. To pass the log record through, return the log record itself. - This option is only available when the `logs` feature is enabled. - ## Session Tracking Options -The following features and options are only available when the `release-health` feature of the `sentry` crate is enabled. +The following features and options are only available when the `release-health` feature of the `sentry` crate is enabled. This is a default feature.