From 4ebb78d978f1548328e4aeca85e0ff25f95c9432 Mon Sep 17 00:00:00 2001 From: Stephanie Anderson Date: Fri, 15 Dec 2023 18:57:24 +0100 Subject: [PATCH] Remove PlatformSection component from Python docs (#8735) --- .../python/configuration/filtering/index.mdx | 60 +- .../python/configuration/options.mdx | 929 +----------------- .../python/configuration/releases.mdx | 35 - .../python/configuration/sampling.mdx | 54 +- .../data-management/sensitive-data/index.mdx | 20 +- .../enriching-events/breadcrumbs/index.mdx | 8 - src/platforms/python/profiling/index.mdx | 318 +----- .../profiling/troubleshooting/index.mdx | 65 +- 8 files changed, 42 insertions(+), 1447 deletions(-) diff --git a/src/platforms/python/configuration/filtering/index.mdx b/src/platforms/python/configuration/filtering/index.mdx index e379fd342e74c..d50e36b146990 100644 --- a/src/platforms/python/configuration/filtering/index.mdx +++ b/src/platforms/python/configuration/filtering/index.mdx @@ -1,7 +1,7 @@ --- title: Filtering -sidebar_order: 60 description: "Learn more about how to configure your SDK to filter events reported to Sentry." +sidebar_order: 60 --- When you add Sentry to your app, you get a lot of valuable information about errors and performance. And lots of information is good -- as long as it's the right information, at a reasonable volume. @@ -18,12 +18,10 @@ Configure your SDK to filter error events by using 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. - + Note also that breadcrumbs can be filtered, as discussed in [our Breadcrumbs documentation](/product/error-monitoring/breadcrumbs/). - - #### Event Hints The callback is passed both the `event` and a second argument, `hint`, that holds one or more hints. @@ -34,10 +32,6 @@ Typically a `hint` holds the original exception so that additional data can be e 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 (, or the event processor system in the SDK). - - - - ### Using Hints Hints are available in two places: @@ -71,36 +65,10 @@ In this example, the fingerprint is forced to a common value if an exception of - - - - -### Using - -You can use the option to filter out errors that match a certain pattern. This option receives a list of strings and regular expressions to match against the error message. When using strings, partial matches will be filtered out, so if you need to filter by exact match, use regex patterns instead. - - - - - - -### Using - -You can use the option to filter out errors that match a type or subtype. - - - - - - ### Decluttering Sentry - - - - ## Filtering Transaction Events To prevent certain transactions from being reported to Sentry, use the or configuration option, which allows you to provide a function to evaluate the current transaction and drop it if it's not one you want. @@ -119,30 +87,6 @@ If the transaction currently being processed has a parent transaction (from an u Learn more about configuring the sample rate. - - ### Using - - - - - -### Using - -You can use the option to filter out transactions that match a certain pattern. This option receives a list of strings and regular expressions to match against the transaction name. When using strings, partial matches will be filtered out, so if you need to filter by exact match, use regex patterns instead. - - - - - - -### Using - -You can use the option to filter out transactions that match a certain string. - - - - - diff --git a/src/platforms/python/configuration/options.mdx b/src/platforms/python/configuration/options.mdx index 219923163b0d5..2c24d7f5bd00d 100644 --- a/src/platforms/python/configuration/options.mdx +++ b/src/platforms/python/configuration/options.mdx @@ -1,7 +1,7 @@ --- title: Basic Options -sidebar_order: 1 description: "Learn more about how to configure the SDK. These options are set when the SDK is first initialized, passed to the init function as an object." +sidebar_order: 1 --- SDKs are configurable using a variety of options. The options are largely standardized among SDKs, but there are some differences to better accommodate platform peculiarities. Options are set when the SDK is first @@ -23,176 +23,26 @@ Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-uti - - -- Original - Default .NET stack trace format. -- Enhanced - Include `async`, return type, arguments, and more. - -Before version 3.0.0 of the Sentry SDK for .NET, there was no special treatment for the stack trace. Sentry reported what .NET made available at runtime. -This behavior now called `StackTraceMode.Original`. With the introduction of 3.0, a new default mode is `Enhanced`. - - - -Changing this value will affect issue grouping. Since the frame significantly changes shape. - - - - - - - -Specifies whether to use global scope management mode. Should be `true` for client applications and `false` for server applications. - -Example scenarios where it should be explicitly set to true: - -- Universal Windows platform (UWP) applications -- WinForms applications -- Windows Presentation Foundation (WPF) applications -- Single user console applications - -Defaults to `false`, unless in Blazor WASM, MAUI, Unity, or Xamarin where the default is `true`. - - - - - -Allows you to specify a path to the local event- and crash-database of the Native SDK. This path will default to `.sentry-native` relative to the current working directory (`CWD`). While this is a convenient setting for development, we strongly urge you to provide an explicit database path for our production deployments. In many deployment scenarios, the path relative to the `CWD` will not be writable. For this reason, you should store the database in your application's user-specific data/cache directory (e.g., under `%AppData%\Local` on Windows, `~/Library/Application Support` on macOS, or `XDG_CACHE_HOME` on Linux). - - - - + Turns debug mode on or off. If debug is enabled SDK will attempt to print out useful debugging information if something goes wrong with sending the event. The default is always `false`. It's generally not recommended to turn it on in production, though turning `debug` mode on will not cause any safety concerns. - - -If enabled, the SDK prints out debug information about if something went wrong while sending events. -It isn't recommended to use this in production. - - - - - - - -Enabling `debug` mode makes the SDK generate as much diagnostic data as possible. However, if you'd prefer to lower the verbosity of the Sentry SDK diagnostics logs, configure this option to set the appropriate level: - -- `debug`: **default** The most verbose mode -- `info`: Informational messages -- `warning`: Warning that something might not be right -- `error`: Only SDK internal errors are printed -- `fatal`: Only critical errors are printed - - - - - -For app models that don't have a console to print to, you can customize the SDK's diagnostic logger to write to a file or to Visual Studio's debug window. - - - - - -Sets the release. Some SDKs will try to automatically configure a release out of the box but it's a better idea to manually set it to guarantee that the release is in sync with your deploy integrations or source map uploads. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the sandbox. - - - - - -Sets the distribution of the application. Distributions are used to disambiguate build or deployment variants of the same release of an application. For example, the dist can be the build number of an Xcode build or the version code of an Android build. The dist has a max length of 64 characters. - - - - + Sets the release. Some SDKs will try to automatically configure a release out of the box but it's a better idea to manually set it to guarantee that the release is in sync with your deploy integrations or source map uploads. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the sandbox. - - By default the SDK will try to read this value from the `SENTRY_RELEASE` environment variable (in the browser SDK, this will be read off of the `window.SENTRY_RELEASE.id` if available). - - - - -By default the SDK will read properties from the Electron `app` module to create the release in the format `appName@version`. - - - - - -By default the SDK will read from `Application.productName` and `Application.version` to create the release in the format `$"{Application.productName}@{Application.version}".` - - - - - -Sets the environment. This string is freeform and not set by default. A release can be associated with more than one environment to separate them in the UI (think `staging` vs `prod` or similar). - -By default the SDK will try to read this value from the `SENTRY_ENVIRONMENT` environment variable (except for the browser SDK where this is not applicable). - - - - - -Sets the environment. This string is freeform and set by default. A release can be associated with more than one environment to separate them in the UI (think `staging` vs `prod` or similar). - -By default the SDK will try to read this value from the `SENTRY_ENVIRONMENT` environment variable. Otherwise, the default environment is `production`. - - - - - -Sets the environment. Defaults to `development` or `production` depending on whether the application is packaged. - - - - - -Sets the environment. This string is freeform and set by default. A release can be associated with more than one environment to separate them in the UI (think `staging` vs `prod` or similar). - -By default, the SDK reports `editor` when running inside the Unity Editor. Otherwise, the default environment is `production`. - - - - - -Sets the environment. This string is freeform and set by default. A release can be associated with more than one environment to separate them in the UI (think `staging` vs `prod` or similar). - -By default, the SDK reports `debug` when the debugger is attached. Otherwise, the default environment is `production`. - -Additionally, if you are running with the ASP.NET Core integration, you will also see the environment named as `staging`, if running in staging, or `development`, if running in development mode. - - - - - Sets the environment. This string is freeform and set to `production` by default. A release can be associated with more than one environment to separate them in the UI (think `staging` vs `production` or similar). By default the SDK will try to read this value from the `SENTRY_ENVIRONMENT` environment variable. - - - - - - -Sets the URL that will be used to transport captured events. This can be used to work around ad-blockers or to have more granular control over events sent to Sentry. Adding your DSN is still required when using this option so necessary attributes can be set on the generated Sentry data. This option **requires the implementation** of a custom server endpoint. Learn more and find examples in [Dealing with Ad-Blockers](/platforms/javascript/troubleshooting/#dealing-with-ad-blockers). - - - - - -Sets which errors are reported. It takes the same values as PHP's [`error_reporting`](https://www.php.net/manual/errorfunc.configuration.php#ini.error-reporting) configuration parameter. - -By default all types of errors are be reported (equivalent to `E_ALL`). - @@ -201,7 +51,7 @@ Configures the sample rate for error events, in the range of `0.0` to `1.0`. The - + Dynamically configures the sample rate for error events on a per-event basis. This configuration option accepts a function, which takes two parameters (the `event` and the `hint`), and which returns a boolean (indicating whether the event should be sent to Sentry) or a floating-point number between 0.0 and 1.0, inclusive (where the number indicates the probability the event is sent to Sentry; the SDK will randomly decide whether to send the event with the given probability). @@ -215,32 +65,17 @@ This variable controls the total amount of breadcrumbs that should be captured. - - -The maximum number of [envelopes](https://develop.sentry.dev/sdk/envelopes/) to keep in cache. The SDKs use envelopes to send data, such as events, attachments, user feedback, and sessions to sentry.io. An envelope can contain multiple items, such as an event with a session and two attachments. Depending on the usage of the SDK, the size of an envelope can differ. If the number of envelopes in the local cache exceeds `max-cache-items`, the SDK deletes the oldest envelope and migrates the sessions to the next envelope to maintain the integrity of your release health stats. The default is `30`. - - - - + When enabled, stack traces are automatically attached to all messages logged. Stack traces are always attached to exceptions; however, when this option is set, stack traces are also sent with messages. This option, for instance, means that stack traces appear next to all log messages. - - -This option is turned on by default. - - - - This option is turned off by default. - - Grouping in Sentry is different for events with stack traces and without. As a result, you will get new groups as you enable or disable this flag for certain events. - + If this flag is enabled, certain personally identifiable information (PII) is added by active integrations. By default, no such data is sent. @@ -256,13 +91,13 @@ If you enable this option, be sure to manually remove what you don't want to sen - + If is turned off, scrubs the event payload for sensitive information from a `denylist`. See how to [configure the scrubber here](../../data-management/sensitive-data/#event-scrubber). - + When enabled, source context will be included in events sent to Sentry. This source context includes the five lines of code above and below the line of code where an error happened. @@ -270,7 +105,7 @@ The option is enabled by default. - + When enabled, the SDK will capture a snapshot of local variables to send with the event to help with debugging. @@ -278,85 +113,15 @@ This option is on by default. - + This option can be used to supply a "server name." When provided, the name of the server is sent along and persisted in the event. For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server. - - Most SDKs will attempt to auto-discover this value. - - - - -For ASP.NET and ASP.NET Core applications, the value will default to the server's name. For other application types, the value will default to the computer's name only when the `SendDefaultPii` is set to `true`, because the computer's name can be considered personally identifiable information (PII) in the case of a desktop or mobile application. - - - - - - - - - - - - - -A list of class names that matches exceptions that shouldn't be sent to Sentry. -Checks whether the provided class name is of a given type or subtype. - - - - - - - - - - - -A list of strings that match transaction names that shouldn't be sent to Sentry. - - - - - - - - - - - - - - - - - -When set to `true`, the SDK will send session events to Sentry. This is supported in all browser SDKs, emitting one session per pageload and page navigation to Sentry. In mobile SDKs, when the app goes to the background for longer than 30 seconds, sessions are ended. - - - -When not set to `false`, the SDK tracks sessions linked to the lifetime of the Electron main process. - - - - - -Configures whether stack trace frames are considered as in app frames by default. -You can use this to essentially make `inAppIncludes` or `inAppExcludes` an allow or deny list. -This value is used only if Sentry can not find the origin of the frame. - -- If `considerInAppFramesByDefault` is set to `true`, you only need to maintain `inAppExcludes`. -- Conversely, if `considerInAppFramesByDefault` is set to `false`, you only need to maintain `inAppIncludes`. - - - - + A list of string prefixes of module names that belong to the app. This option takes precedence over `in-app-exclude`. @@ -364,7 +129,7 @@ Sentry differentiates stack frames that are directly related to your application - + A list of string prefixes of module names that do not belong to the app, but rather to third-party packages. Modules considered not part of the app will be hidden from stack traces by default. @@ -372,13 +137,7 @@ This option can be overridden using - - -A list of exception types that will be filtered out before sending to Sentry. - - - - + This parameter controls whether integrations should capture HTTP request bodies. It can be set to one of the following values: @@ -389,7 +148,7 @@ This parameter controls whether integrations should capture HTTP request bodies. - + The number of characters after which the values containing text in the event payload will be truncated (defaults to `1024`). @@ -400,29 +159,13 @@ The number of characters after which the values containing text in the event pay - + A path to an alternative CA bundle file in PEM-format. - - -The number of context lines for each frame in the stack trace when loading a file. - - - - - -The number of context lines for each frame when loading a file. - -#### Deprecated - -`frameContextLines` has moved to the `ContextLines` integration. - - - - + #### Deprecated @@ -430,7 +173,7 @@ Has been renamed to [max_request_body_size](/platforms/python/configuration/opti - + #### Deprecated @@ -438,251 +181,12 @@ Has been renamed to [include_local_variables](/platforms/python/configuration/op - - -Data to be set to the initial scope. Initial scope can be defined either as an object or a callback function, as shown below. - -Object: - - - -```javascript -Sentry.init({ - dsn: "___PUBLIC_DSN___", - debug: true, - initialScope: { - tags: { "my-tag": "my value" }, - user: { id: 42, email: "john.doe@example.com" }, - }, -}); -``` - -Callback function: - -```javascript -Sentry.init({ - dsn: "___PUBLIC_DSN___", - debug: true, - initialScope: (scope) => { - scope.setTags({ a: "b" }); - return scope; - }, -}); -``` - - - - - -A block that configures the initial scope when starting the SDK. - - - -```swift -import Sentry - -SentrySDK.start { options in - options.dsn = "___PUBLIC_DSN___" - options.initialScope = { scope in - scope.setTag(value: "my value", key: "my-tag") - return scope - } -} -``` - -```objc {tabTitle:Objective-C} -@import Sentry; - -[SentrySDK startWithConfigureOptions:^(SentryOptions *options) { - options.dsn = @"___PUBLIC_DSN___"; - options.initialScope = ^(SentryScope *scope) { - scope setTagValue:@"my value" forKey:@"my-tag"]; - return scope; - }; -}]; -``` - -_(New in [sentry-cocoa version 8.7.0](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#870))_ - - - - - -Maximum number of characters a single value can have before it will be truncated (defaults to `250`). - - - - - -Sentry SDKs normalize any contextual data to a given depth. Any data beyond this depth will be trimmed and marked using its type instead (`[Object]` or `[Array]`), without walking the tree any further. By default, walking is performed three levels deep. - - - - - -This is the maximum number of properties or entries that will be included in any given object or array when the SDK is normalizing contextual data. Any data beyond this depth will be dropped. (defaults to 1000) - - - - - -Takes a screenshot of the application when an error happens and includes it as an attachment. -Learn more about enriching events with screenshots in our Screenshots documentation. - - - -_(New in version 4.11.0)_ - - - - - -_(New in version 6.0.0)_ - - - - - - - -The quality of the attached screenshot. It can be set to `full`, `high`, `medium` or `low`. - - - - - -Renders a JSON representation of the entire view hierarchy of the application when an error happens and includes it as an attachment. -Learn more about enriching events with the view hierarchy in our View Hierarchy documentation. - - - - - -The idle time, measured in ms, to wait until a transaction will be automatically finished. The transaction will use the end timestamp of the last finished span as the endtime for the transaction. - -The default is `3000`. - - - -_(New in version 6.0.0)_ - - - -This only affects [user interaction transactions](/platforms/android/performance/instrumentation/automatic-instrumentation/#user-interaction-instrumentation). - - - - - - - - - - - -Inter-process communication mode to receive event and scope updates from renderer processes. - -Available options are: - -- `IPCMode.Classic` - Configures Electron IPC modules -- `IPCMode.Protocol` - Configures a custom protocol and `fetch` -- `IPCMode.Both` (default) - Configures both modes for maximum compatibility - - - -A function that returns an array of Electron `session` objects. These sessions are used to configure communication between the Electron main and renderer processes. - -Defaults to `() => [session.defaultSession]` - - - -Callback function that allows custom naming of renderer processes. - -`(contents: WebContents) => string | undefined` - -If the callback is not set, or it returns `undefined`, the default naming scheme is used. - - - - - -Specifies whether this SDK should send events to Sentry. Defaults to `true`. Setting this to `enabled: false` doesn't prevent all overhead from Sentry instrumentation. To disable Sentry completely, depending on environment, call `Sentry.init` conditionally. - - - - + Set this boolean to `false` to disable sending of client reports. Client reports are a protocol feature that let clients send status reports about themselves to Sentry. They are currently mainly used to emit outcomes for events that were never sent. - - -_(New in version 6.0.0)_ - - - - - -_(New in version 7.13.0)_ - - - - - -_(New in version 6.6.0)_ - - - - - - - -Once enabled, this feature automatically captures HTTP client errors, like bad response codes, as error events and reports them to Sentry. - - - -_(New in version 7.0.0)_ - - - - - - - -Once enabled, this feature automatically captures HTTP client errors, like bad response codes, as error events and reports them to Sentry. - - - -_(New in version 5.3.0)_ - - - - - -_(New in version 7.30.0)_ - - - - - - - -Set this boolean to `true` to add stack local variables to stack traces. - - - -Due to an [open Node.js issue](https://github.com/nodejs/node/issues/38439), we -are currently unable to capture local variables for unhandled errors when using -JavaScript modules (ESM). - -See the integration -options for a workaround. - - - - - ## Integration Configuration For many platform SDKs integrations can be configured alongside it. On some platforms that happen as part of the `init()` call, in some others, different patterns apply. @@ -691,27 +195,18 @@ For many platform SDKs integrations can be configured alongside it. On some plat In some SDKs, the integrations are configured through this parameter on library initialization. For more information, please see our documentation for a specific integration. - + This can be used to disable integrations that are added by default. When set to `false`, no default integrations are added. - + This can be used to disable integrations that are enabled by default if the SDK detects that the corresponding framework or library is installed. When set to `false`, none of these integrations will be enabled by default, even if the corresponding framework/library is detected. - - ## Hooks These options can be used to hook the SDK in various ways to customize the reporting of events. - - -The callbacks you set as hooks will be called on the thread where the event happened. So you can only use -thread-safe APIs and only use Unity-specific APIs after you've checked that you're on the UI thread. - - - 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. @@ -720,245 +215,78 @@ By the time is executed, all scope dat - + 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. - - - - - - - - -This function is called with a backend-specific event object, and can return a modified event object or nothing to skip reporting the event. In contrast to `before_send`, it is only called when a crash occurred. You can find detailed information concerning its usage in [Filtering](/platforms/native/configuration/filtering/#using-on_crash). - - + 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. 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. - - - - -This function is called with an event and the result of sending that event. This is useful to log send results, instrument Sentry calls, and so on. - - - - - - - ## Transport Options Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments. - + 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. - - -Options used to configure the transport. This is an object with the following possible optional keys: - - - -- `headers`: An object containing headers to be sent with every request. -- `proxy`: A proxy used for outbound requests. Can be http or https. -- `caCerts`: A path or list of paths to a CA certificate, or a buffer of CA certificates. -- `httpModule`: A custom HTTP module to use for requests. Defaults to the the native `http` and `https` modules. -- `keepAlive`: Determines whether to keep the socket alive between requests. Defaults to `false`. - - - - - -- `headers`: An object containing headers to be sent with every request. Used by the SDK's fetch and XHR transports. -- `fetchOptions`: An object containing options to be passed to the `fetch` call. Used by the SDK's fetch transport. - - - - - - - Configures an HTTP proxy for outgoing requests to the backend, (HTTPS requests - tunneled through that proxy). The Native SDK doesn't pick up the `http_proxy` - environment variable. You can find more details on the [transport - page](/platforms/native/configuration/transports/#using-an-http-proxy). - - - + When set, a proxy can be configured that should be used for outbound requests. This is also used for HTTPS requests unless a separate `https-proxy` is configured. However, not all SDKs support a separate HTTPS proxy. SDKs will attempt to default to the system-wide configured proxy, if possible. For instance, on Unix systems, the `http_proxy` environment variable will be picked up. - + Configures a separate proxy for outgoing HTTPS requests. This value might not be supported by all SDKs. When not supported the `http-proxy` value is also used for HTTPS requests at all times. - + A dict containing additional proxy headers (usually for authentication) to be forwarded to `urllib3`'s [`ProxyManager`](https://urllib3.readthedocs.io/en/1.24.3/reference/index.html#urllib3.poolmanager.ProxyManager). - - -Specifies a local directory used for caching payloads. When this option is enabled (that is, when the directory is set), the Sentry SDK will persist envelopes locally before sending to Sentry. This configuration option is particularly useful if you expect your application to run in environments where internet connectivity is limited. - - - - - -Default: set to `android.content.Context.getCacheDir()/sentry`. - - - - - -Default: not set (caching is disabled). - - - - - -The default value is `Application.persistentDataPath`. You can disable offline caching by setting it to `null`. - - - - - -The default value is `Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)`. - - - - - -The default value is `Path.Combine(FileSystem.CacheDirectory, "sentry")`. See the [Microsoft docs](https://docs.microsoft.com/dotnet/maui/platform-integration/storage/file-system-helpers#platform-differences) for how `FileSystem.CacheDirectory` differs on each supported platform. - - - - - -When caching is enabled (that is, is set), this option controls the timeout that limits how long the SDK will attempt to flush existing cache during initialization. Note that flushing the cache involves sending the payload to Sentry in a blocking operation. Setting this option to zero means that Sentry will **not** attempt to flush the cache during initialization, but instead will do so when the next payload is queued up. - -The default is `1` (one) second. - - - - + 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. - - -_Deprecated._ Controls how many times the SDK will attempt to resend an event to Sentry. The default is `0`. - - - - - -The maximum number of seconds to wait while trying to connect to a server. The default is `2`. - - - - - -The maximum execution time, in seconds, for the request+response as a whole. The value should also include the time for the connect phase, so it should be greater than the value set for the `http_connect_timeout` option. The default is `5`. - - - - - - - - - -Controls whether to report events to Sentry _synchronously_ (if set to `:sync`) or _asynchronously_ (if set to `:none`). Defaults to `:none`. - - - - - -The maximum number of attempts to send an event to Sentry. Defaults to `4`. - - - - - -The HTTP client to use for sending events to Sentry. This must be a module that implements the [`Sentry.HTTPClient`](https://hexdocs.pm/sentry/Sentry.HTTPClient.html) behaviour. Defaults to `Sentry.HackneyClient`, which is based on the [Hackney](https://hexdocs.pm/hackney) HTTP client. - - - - - -Options to be passed to Hackney. Only applied if `client` is set to `Sentry.HackneyClient`. Defaults to `[pool: :sentry_pool]`. - - - - - -The maximum number of connections to keep in the pool. Only applied if `client` is set to `Sentry.HackneyClient`. Defaults to `50`. - - - - - -The maximum time to wait (in milliseconds) for a connection to become available. Only applied if `client` is set to `Sentry.HackneyClient`. Defaults to `5000`. - - - - - - - ## Tracing Options - + A boolean value, if true, transactions and trace data will be generated and captured. This will set the `traces-sample-rate` to the recommended default of 1.0 if `traces-sample-rate` is not defined. Note that `traces-sample-rate` and `traces-sampler` take precedence over this option. - + A number between 0 and 1, controlling the percentage chance a given transaction will be sent to Sentry. (0 represents 0% while 1 represents 100%.) Applies equally to all transactions created in the app. Either this or must be defined to enable tracing. - If is 0, this means that no new traces will be created. However, if you have another service (for example a JS frontend) that makes requests to your service that include trace information, those traces will be continued and thus transactions will be sent to Sentry. If you want to disable all tracing you need to set `=None` or set `=False`. In this case, no new traces will be started and no incoming traces will be continued. - - - + A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or must be defined to enable tracing. - - -An optional property that configures which downstream services receive the `sentry-trace` header attached to HTTP requests. It contains a list of URLs or regex against which URLs are matched. If not set, the `sentry-trace` header is attached to every request executed from an instrumented client. - - - - + An optional property that controls which downstream services receive tracing data, in the form of a `sentry-trace` and a `baggage` header attached to any outgoing HTTP requests. @@ -970,7 +298,7 @@ If is not provided, trac - + An optional list of functions that should be set up for performance monitoring. For each function in the list, a span will be created when the function is executed. Functions in the list are represented as strings containing the fully qualified name of the function. @@ -981,7 +309,7 @@ To learn more, see the [Custom Instrumentation](/platforms/python/performance/in - + When enabled, a new monitor thread will be spawned to perform health checks on the SDK. If the system is unhealthy, the SDK will keep halving the `traces_sample_rate` set by you in 10 second intervals until recovery. This downsampling helps ensure that the system stays stable and reduces SDK overhead under high load. @@ -989,7 +317,7 @@ This option is enabled by default. - + When enabled, the source location will be added to database queries. @@ -997,7 +325,7 @@ This option is disabled by default. - + The threshold in milliseconds for adding the source location to database queries. The query location will be added to the query for queries slower than the specified threshold. @@ -1006,190 +334,3 @@ You need to set `enable_db_query_source` to `True` for this to work. Default is `100` ms. - - - - - -Set this boolean to `false` to disable tracing for `OPTIONS` requests. This options default value will likely be changed in the next major version, meaning you will have to set it to `true` if you want to keep tracing `OPTIONS` requests. - - - - - - - - - -## Experimental Features - - - -An optional property that configures which features are in experimental mode. This property is either an `Object Type` with properties or a key/value `TypedDict`, depending the language. Experimental features are still in-progress and may have bugs. We recognize the irony. - - - -## Hybrid SDK Options - - - -Set this boolean to `false` to disable the native SDK. This will disable all native crash and error handling and, instead, the SDK will only capture errors on the upper layer. - - - - - -Set this boolean to `false` to disable the auto initialization of the native layer SDK. Doing so means you will need to initialize the native SDK manually. Do not use this to disable the native layer. - - - -To disable the native layer, use [enableNative](#enableNative). - -You should follow the [guide to native initialization](/platforms/react-native/manual-setup/native-init/) if you chose to use this option. - - - - - -You should follow the [guide to native initialization](/platforms/flutter/native-init/) if you chose to use this option. - - - - - - - -Set this boolean to `false` to disable hard crash handling from the native layer. Doing so means that the SDK won't capture events for hard crashes on Android and iOS if the error was caused by native code. - - - - - -Set this boolean to `false` to disable the native nagger alert being shown. - - - - - -Set this boolean to `false` to disable the [release health](/product/releases/health/) feature. - - - - - -Set this to change the default interval to end a session (release health) if the app goes to the background. Default is 30,000. - - - - - -Set this boolean to `false` to disable the scope sync from Java to NDK on Android. - - - - - -Set this boolean to `true` to automatically attach all threads to all logged events on Android. - - - - - -Set this boolean to `false` to disable auto [performance monitoring](/product/performance/) tracking. - - - - - - - -Set this boolean to `false` to disable auto [performance monitoring](/product/performance/) tracking. - - - - - - - -Set this boolean to `false` to disable [out of memory](/platforms/apple/guides/ios/configuration/out-of-memory/) tracking on iOS. - - - - - - - Available since version 8.0.0 of Sentry Apple SDK. It was named - `enableOutOfMemoryTracking` before the 8.0.0 release. - - -Set this boolean to `false` to disable [watchdog termination](/platforms/apple/guides/ios/configuration/watchdog-terminations/) tracking on iOS. - - - - - -Set this callback, which is called after the Sentry React Native SDK initializes its Native SDKs (Android and iOS). - - - - - -Set this boolean to `false` to disable sync of `Scope` data to Android and iOS SDKs. - - - - - -Set this boolean to `false` to disable reporting all the package dependencies. - - - - - -Set this boolean to `true` to enable ANR (Application Not Responding) detection on Android. - - - - - -Set this to change the default interval of the ANR detection. The default is `5` seconds. - - - - - -Set this boolean to `true` to enable reporting [FlutterErrorDetails.silent](https://api.flutter.dev/flutter/foundation/FlutterErrorDetails/silent.html) errors automatically. - - - - - -Set this boolean to `false` to disable automatic app start tracking. - - - - - -Set this boolean to `false` to disable automatic breadcrumbs on the Native platforms. - - - - - -Set this boolean to `false` to disable automatic User Interactions breadcrumbs. - - - - - -Set this boolean to `false` to disable automatic User Interactions tracing. - - - - - -Sets the Proguard UUID for Android platform - - - - diff --git a/src/platforms/python/configuration/releases.mdx b/src/platforms/python/configuration/releases.mdx index c0f624f1db625..f16a96655daa9 100644 --- a/src/platforms/python/configuration/releases.mdx +++ b/src/platforms/python/configuration/releases.mdx @@ -4,16 +4,6 @@ sidebar_order: 40 description: "Learn how to configure your SDK to tell Sentry about your releases." --- - - - - -The Crash Free Session Rate requires [native support](/platforms/unity/native-support/). On platforms that don't yet have native support, the SDK reports sessions that did not end gracefully as _Abnormal_, which leads to 100% crash free sessions being recorded. If you're building on a platform that doesn't have native support yet, you should monitor your app's _Abnormal_ rate. - - - - - A release is a version of your code that is deployed to an environment. When you give Sentry information about your releases, you can: - Determine issues and regressions introduced in a new release @@ -21,12 +11,6 @@ A release is a version of your code that is deployed to an - -Additionally, releases are used for applying [source maps](/platforms/javascript/sourcemaps/) to minified JavaScript to view original, untransformed source code. - - - ## Bind the Version Include a release ID (often called a "version") when you initialize the SDK. @@ -74,8 +58,6 @@ If you don't tell Sentry about a new release, Sentry will automatically create a After configuring your SDK, you can install a repository integration or manually supply Sentry with your own commit metadata. Read our documentation about [setting up releases](/product/releases/setup/) for further information about integrations, associating commits, and telling Sentry when deploying releases. - - ## Release Health Monitor the [health of releases](/product/releases/health/) by observing user adoption, usage of the application, percentage of [crashes](/product/releases/health/#crash), and [session data](/product/releases/health/#session). Release health will provide insight into the impact of crashes and bugs as it relates to user experience, and reveal trends with each new issue through the [Release Details](/product/releases/release-details/) graphs and filters. @@ -92,21 +74,4 @@ In order to monitor release health, the SDK sends session data. 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. - - - - - - - - - -Release health support for .NET is currently limited to single-instance **client** applications only. This means it can be used with WPF, Xamarin, WinForms and similar app models. -Support for server frameworks such as ASP.NET is planned. - - - - - - diff --git a/src/platforms/python/configuration/sampling.mdx b/src/platforms/python/configuration/sampling.mdx index 6a4820fa43209..17a299e627a71 100644 --- a/src/platforms/python/configuration/sampling.mdx +++ b/src/platforms/python/configuration/sampling.mdx @@ -1,7 +1,7 @@ --- title: Sampling -sidebar_order: 50 description: "Learn how to configure the volume of error and transaction events sent to Sentry." +sidebar_order: 50 --- Adding Sentry to your app gives you a great deal of very valuable information about errors and performance you wouldn't otherwise get. And lots of information is good -- as long as it's the right information, at a reasonable volume. @@ -12,7 +12,7 @@ To send a representative sample of your errors to Sentry, set the -The error sample rate defaults to `1`, meaning all errors are sent to Sentry. +The error sample rate defaults to `1.0`, meaning all errors are sent to Sentry. @@ -20,8 +20,6 @@ Changing the error sample rate requires re-deployment. In addition, setting an S - - ### Dynamically Sampling Error Events To sample error events dynamically, set the to a function that returns the desired sample rate for the event. The takes two arguments, and , which it uses to inform the sampling decision. @@ -45,10 +43,6 @@ You can define at most one of the an - - - - ## Sampling Transaction Events We recommend sampling your transactions for two reasons: @@ -75,28 +69,12 @@ The Sentry SDKs have two configuration options to control the volume of transact By default, none of these options are set, meaning no transactions will be sent to Sentry. You must set either one of the options to start sending transactions. - - - - -Sampling functions () are currently not supported by this platform. - - - - - ### Setting a Uniform Sample Rate - - - - ### Setting a Sampling Function - - ## Sampling Context Data @@ -113,24 +91,12 @@ When using custom instrumentation to create a transaction, you can add data to t - - ## Inheritance Whatever a transaction's sampling decision, that decision will be passed to its child spans and from there to any transactions they subsequently cause in other services. - - -(See Distributed Tracing for more about how that propagation is done.) - - - - - (See Distributed Tracing for more about how that propagation is done.) - - If the transaction currently being created is one of those subsequent transactions (in other words, if it has a parent transaction), the upstream (parent) sampling decision will be included in the sampling context data. Your can use this information to choose whether to inherit that decision. In most cases, inheritance is the right choice, to avoid breaking distributed traces. A broken trace will not include all your services. @@ -141,16 +107,12 @@ In some SDKs, for convenience, the If you're using a rather than a , the decision will always be inherited. - - ## Forcing a Sampling Decision If you know at transaction creation time whether or not you want the transaction sent to Sentry, you also have the option of passing a sampling decision directly to the transaction constructor (note, not in the object). If you do that, the transaction won't be subject to the , nor will be run, so you can count on the decision that's passed not to be overwritten. - - ## Precedence There are multiple ways for a transaction to end up with a sampling decision. @@ -167,15 +129,3 @@ When there's the potential for more than one of these to come into play, the fol 1. If is defined, its decision will be used. It can choose to keep or ignore any parent sampling decision, use the sampling context data to make its own decision, or choose a sample rate for the transaction. We advise against overriding the parent sampling decision because it will break distributed traces) 1. If is not defined, but there's a parent sampling decision, the parent sampling decision will be used. 1. If is not defined and there's no parent sampling decision, will be used. - - - - - -Forcing a sampling decision by passing it into is currently not supported by this platform. - - - - - - diff --git a/src/platforms/python/data-management/sensitive-data/index.mdx b/src/platforms/python/data-management/sensitive-data/index.mdx index 758520870265a..2f65599650667 100644 --- a/src/platforms/python/data-management/sensitive-data/index.mdx +++ b/src/platforms/python/data-management/sensitive-data/index.mdx @@ -7,8 +7,6 @@ keywords: - gdpr - "personally identifiable data" - compliance -redirect_from: - - /learn/sensitive-data/ --- As with any third-party service it's important to understand what data is being sent to Sentry, and where relevant ensure sensitive data either never reaches the Sentry servers, or at the very least it doesn’t get stored. @@ -33,41 +31,27 @@ If you are using Sentry in your mobile app, read our [frequently asked questions - - ## 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). 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). - - - - If you _do not_ wish to use the default PII behavior, you can also choose to identify users in a more controlled manner, using our [user identity context](../../enriching-events/identify-user/). - - - - ## Scrubbing Data - - ### `event_scrubber` You can use the configuration parameter to simplify removing sensitive data from your event payload. - - ### & 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. - + Sensitive data may appear in the following areas: @@ -104,5 +88,3 @@ 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/)) - - diff --git a/src/platforms/python/enriching-events/breadcrumbs/index.mdx b/src/platforms/python/enriching-events/breadcrumbs/index.mdx index 118609d3350af..91ecb1c6999cc 100644 --- a/src/platforms/python/enriching-events/breadcrumbs/index.mdx +++ b/src/platforms/python/enriching-events/breadcrumbs/index.mdx @@ -31,14 +31,6 @@ The available breadcrumb keys are `type`, `category`, `message`, `level`, `times SDKs allow you to customize breadcrumbs through the hook. - - -You'll first need to import the SDK, as usual: - - - - - 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`: diff --git a/src/platforms/python/profiling/index.mdx b/src/platforms/python/profiling/index.mdx index bf0bf4958ac48..293e1e84a1d6c 100644 --- a/src/platforms/python/profiling/index.mdx +++ b/src/platforms/python/profiling/index.mdx @@ -1,32 +1,7 @@ --- title: Set Up Profiling -sidebar_order: 5000 -supported: - - android - - apple - - flutter - - go - - python - - ruby - - react-native -notSupported: - - unity - - dart - - native - - javascript - - javascript.vue - - dotnet - - java - - java.spring-boot - - java.spring - - javascript.cordova - - native.breakpad - - native.crashpad - - native.minidumps - - unreal - - native.wasm - - rust description: "Learn how to enable profiling in your app if it is not already set up." +sidebar_order: 5000 --- @@ -37,88 +12,6 @@ With [profiling](/product/profiling/), Sentry allows you to collect and analyze Profiling depends on Sentry’s performance monitoring product being enabled beforehand. To enable performance monitoring in the SDK: - - - - -```swift {tabTitle:Swift} -import Sentry - -SentrySDK.start { options in - options.dsn = "___PUBLIC_DSN___" - options.tracesSampleRate = 1.0 -} -``` - -```objc {tabTitle:Objective-C} -@import Sentry; - -[SentrySDK startWithConfigureOptions:^(SentryOptions *options) { - options.dsn = @"___PUBLIC_DSN___"; - options.tracesSampleRate = @1.0; -}]; -``` - - - - - -In `AndroidManifest.xml`: - -```xml - - - - -``` - - - - - -```javascript -Sentry.init({ - dsn: "___DSN___", - tracesSampleRate: 1.0, -}); -``` - - - - - - - -```dart -SentryFlutter.init( - (options) => { - options.dsn = '___PUBLIC_DSN___'; - // We recommend adjusting this value in production: - options.tracesSampleRate = 1.0; - }, - appRunner: () => runApp(MyApp()), -); -``` - - - - - - - -```go -err := sentry.Init(sentry.ClientOptions{ - Dsn: "___PUBLIC_DSN___", - EnableTracing: true, - // We recommend adjusting this value in production: - TracesSampleRate: 1.0, -}) -``` - - - - - ```python @@ -128,99 +21,10 @@ sentry_sdk.init( ) ``` - - - - - - -```ruby -Sentry.init do |config| - config.dsn = '___PUBLIC_DSN___' - config.traces_sample_rate = 1.0 -end -``` - - - Check out the performance setup documentation for more detailed information on how to configure sampling. Setting the sample rate to 1.0 means all transactions will be captured. - - -By default, some transactions will be created automatically for common operations like loading a view controller/activity and app startup. - - - ## Enable Profiling - - - - -iOS profiling is available starting in SDK version `8.12.0`. - - - - - -```swift {tabTitle:Swift} -import Sentry - -SentrySDK.start { options in - options.dsn = "___PUBLIC_DSN___" - options.tracesSampleRate = 1.0 // tracing must be enabled for profiling - options.profilesSampleRate = 1.0 // see also `profilesSampler` if you need custom sampling logic -} -``` - -```objc {tabTitle:Objective-C} -@import Sentry; - -[SentrySDK startWithConfigureOptions:^(SentryOptions *options) { - options.dsn = @"___PUBLIC_DSN___"; - options.tracesSampleRate = @1.0; // tracing must be enabled for profiling - options.profilesSampleRate = @1.0; // see also `profilesSampler` if you need custom sampling logic -}]; -``` - - - -The setting is _relative_ to the setting. - - - - - - - - - -Android profiling is available starting in SDK version `6.16.0`. - - - -In `AndroidManifest.xml`: - - - -```xml - - - - - -``` - - - -The `io.sentry.traces.profiling.sample-rate` setting is _relative_ to the `io.sentry.traces.sample-rate` setting. - - - - - - - Python profiling is available starting in SDK version `1.18.0`. @@ -272,123 +76,3 @@ sentry_sdk.init( }, ) ``` - - - - - - - -Profiling for React Native is available in beta in SDK versions `5.8.0` and above. Currently, it supports profiling the JavaScript layer. Combined profiling with native Android/iOS layers isn't supported at this time. - - - -To enable profiling, set the `profilesSampleRate`: - -```javascript -Sentry.init({ - dsn: "___DSN___", - tracesSampleRate: 1.0, - _experiments: { - // profilesSampleRate is relative to tracesSampleRate. - // Here, we'll capture profiles for 100% of transactions. - profilesSampleRate: 1.0, - }, -}); -``` - - - - - - - -Flutter Profiling alpha is available for iOS and macOS since SDK version `7.12.0`. - - - -To enable profiling, set the `profilesSampleRate`: - - - -```dart -SentryFlutter.init( - (options) => { - options.dsn = '___PUBLIC_DSN___'; - // We recommend adjusting this value in production: - options.tracesSampleRate = 1.0; - // The sampling rate for profiling is relative to tracesSampleRate - // Setting to 1.0 will profile 100% of sampled transactions: - options.profilesSampleRate = 1.0; - }, - appRunner: () => runApp(MyApp()), -); -``` - - - - - - - -Go Profiling alpha is available since SDK version `0.22.0`. - - - -To enable profiling, set the `ProfilesSampleRate`: - - - -```go -err := sentry.Init(sentry.ClientOptions{ - Dsn: "___PUBLIC_DSN___", - EnableTracing: true, - // We recommend adjusting these values in production: - TracesSampleRate: 1.0, - // The sampling rate for profiling is relative to TracesSampleRate: - ProfilesSampleRate: 1.0, -}) -``` - - - - - - - -Ruby profiling beta is available starting in SDK version `5.9.0`. - - - -We use the [`stackprof` gem](https://github.com/tmm1/stackprof) to collect profiles for Ruby. - -First add `stackprof` to your `Gemfile` and make sure it is loaded before `sentry-ruby`. - -```ruby -# Gemfile - -gem 'stackprof' -gem 'sentry-ruby' -``` - -Then, make sure both `traces_sample_rate` and `profiles_sample_rate` are set and non-zero in your Sentry initializer. - - - -```ruby -# config/initializers/sentry.rb - -Sentry.init do |config| - config.dsn = "___PUBLIC_DSN___" - config.traces_sample_rate = 1.0 - config.profiles_sample_rate = 1.0 -end -``` - - - -The setting is _relative_ to the setting. - - - - diff --git a/src/platforms/python/profiling/troubleshooting/index.mdx b/src/platforms/python/profiling/troubleshooting/index.mdx index d8bf2b7442f24..4d8763caa6863 100644 --- a/src/platforms/python/profiling/troubleshooting/index.mdx +++ b/src/platforms/python/profiling/troubleshooting/index.mdx @@ -1,32 +1,7 @@ --- title: Troubleshooting -sidebar_order: 5000 -supported: - - android - - apple - - go - - python - - rust - - ruby - - react-native -notSupported: - - unity - - dart - - flutter - - native - - javascript - - javascript.vue - - dotnet - - java - - java.spring-boot - - java.spring - - javascript.cordova - - native.breakpad - - native.crashpad - - native.minidumps - - unreal - - native.wasm description: "Learn how to troubleshoot your profiling setup." +sidebar_order: 5000 --- If you don't see any profiling data in [sentry.io](https://sentry.io), you can try the following: @@ -35,41 +10,3 @@ If you don't see any profiling data in [sentry.io](https://sentry.io), you can t - Ensure that the automatic instrumentation is sending performance data to Sentry by going to the **Performance** page in [sentry.io](https://sentry.io). - If the automatic instrumentation is not sending performance data, try using custom instrumentation. - Enable debug mode in the SDK and check the logs. - - - -### Limitations - -Profiling is currently available only for iOS and macOS. - - - - - -### Limitations - -Profile samples are collected periodically for each goroutine. -If your program uses a large number of concurrent goroutines, make sure to check whether the overhead is within the acceptable range for your use case. - -As always, and especially with Profiling in Go being an alpha feature, feedback is welcome on [Discord](https://discord.com/channels/621778831602221064/621786587939864586) or [GitHub](https://github.com/getsentry/sentry-go/issues/630). - - - - - -### Limitations - -Profiles for multi-threaded servers like `puma` might not capture frames correctly when async I/O is happening. This is a limitation of `stackprof`. - - - - - -### Limitations - -Because profile samples are collected at a fixed sampling frequency, we recommend checking if profiling's [Performance Overhead](/product/profiling/performance-overhead) is acceptable for your use case. Note that -we're working on symbolication of the collected profiles which means that at the moment you'll see only function names but not resolved source file paths. - -As always, and especially since Profiling in React Native is an alpha feature, feedback is welcome on [Discord](https://discord.com/channels/621778831602221064/750735628932612096) or [GitHub](https://github.com/getsentry/sentry-react-native/issues/2668). - -