You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding types and defaults to Flutter options (#15213)
## DESCRIBE YOUR PR
Flutter needed types and defaults added from the SDKoption migration
Preview:
https://sentry-docs-git-flutter-options-updates.sentry.dev/platforms/dart/guides/flutter/configuration/options/
## IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+
## SLA
- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!
## PRE-MERGE CHECKLIST
*Make sure you've checked the following before merging your changes:*
- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
---------
Co-authored-by: Shannon Anahata <[email protected]>
Co-authored-by: Giancarlo Buenaflor <[email protected]>
The DSN tells the SDK where to send the events. If this value is not provided, the SDK will try to read it from the `SENTRY_DSN` environment variable. If that variable also does not exist, the SDK will just not send any events.
17
+
The DSN tells the SDK where to send the events. If this value is not provided, the SDK will try to read it from the `SENTRY_DSN` environment variable. If that variable also does not exist, the SDK will not send any events.
18
18
19
19
In runtimes without a process environment (such as the browser) that fallback does not apply.
20
20
21
21
Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization).
22
22
23
23
</SdkOption>
24
24
25
-
<SdkOptionname="debug">
25
+
<SdkOptionname="debug"type="bool"defaultNote="true in debug mode, false otherwise">
26
26
27
27
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 `true` if your app runs in [debug mode](https://docs.flutter.dev/testing/build-modes#debug), otherwise it is `false`. It's generally not recommended to turn it on in production, though turning `debug` mode on will not cause any safety concerns.
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:
34
34
35
-
-`debug`: **default**The most verbose mode
35
+
-`debug`: The most verbose mode
36
36
-`info`: Informational messages
37
-
-`warning`: Warning that something might not be right
37
+
-`warning`: **default**Warning that something might not be right
38
38
-`error`: Only SDK internal errors are printed
39
39
-`fatal`: Only critical errors are printed
40
40
41
41
</SdkOption>
42
42
43
-
<SdkOptionname="dist">
43
+
<SdkOptionname="dist"type="string">
44
44
45
45
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 <SandboxLinkscenario="releases">sandbox</SandboxLink>.
52
52
53
53
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).
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).
60
60
61
61
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).
Configures the sample rate for error events, in the range of `0.0` to `1.0`. The default is `1.0`, which means that 100% of error events will be sent. If set to `0.1`, only 10% of error events will be sent. Events are picked randomly.
This variable controls the total amount of breadcrumbs that should be captured. This defaults to `100`, but you can set this to any number. However, you should be aware that Sentry has a [maximum payload size](https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits) and any events exceeding that payload size will be dropped.
The maximum number of [envelopes](https://develop.sentry.dev/sdk/data-model/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.
86
86
@@ -90,7 +90,7 @@ Grouping in Sentry is different for events with stack traces and without. As a r
If this flag is enabled, certain personally identifiable information (PII) is added by active integrations. By default, no such data is sent.
96
96
@@ -106,21 +106,21 @@ If you enable this option, be sure to manually remove what you don't want to sen
106
106
107
107
</SdkOption>
108
108
109
-
<SdkOptionname="serverName">
109
+
<SdkOptionname="serverName"type="string">
110
110
111
111
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.
112
112
113
113
Most SDKs will attempt to auto-discover this value.
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.
Configures whether stack trace frames are considered as in app frames by default.
126
126
You can use this to essentially make `inAppIncludes` or `inAppExcludes` an allow or deny list.
@@ -131,68 +131,68 @@ This value is used only if Sentry can not find the origin of the frame.
131
131
132
132
</SdkOption>
133
133
134
-
<SdkOptionname="inAppInclude">
134
+
<SdkOptionname="inAppInclude"type="array">
135
135
136
136
A list of string prefixes of module names that belong to the app. This option takes precedence over `in-app-exclude`.
137
137
138
138
Sentry differentiates stack frames that are directly related to your application ("in application") from stack frames that come from other packages such as the standard library, frameworks, or other dependencies. The application package is automatically marked as `inApp`. The difference is visible in [sentry.io](https://sentry.io), where only the "in application" frames are displayed by default.
139
139
140
140
</SdkOption>
141
141
142
-
<SdkOptionname="inAppExclude">
142
+
<SdkOptionname="inAppExclude"type="array">
143
143
144
144
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.
145
145
146
146
This option can be overridden using <PlatformIdentifiername="inAppInclude" />.
Takes a screenshot of the application when an error happens and includes it as an attachment.
153
153
Enable this option by setting <PlatformIdentifiername="attachScreenshot" /> to `true` and wrapping your root widget with `SentryWidget(child: MyApp())`.
154
154
Learn more about enriching events with screenshots in our <PlatformLinkto="/enriching-events/screenshots/">Screenshots documentation</PlatformLink>.
Renders a JSON representation of the entire view hierarchy of the application when an error happens and includes it as an attachment.
167
167
Learn more about enriching events with the view hierarchy in our <PlatformLinkto="/enriching-events/viewhierarchy/">View Hierarchy documentation</PlatformLink>.
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.
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.
This parameter controls whether integrations should capture HTTP request bodies. It can be set to one of the following values:
198
198
@@ -207,7 +207,7 @@ This parameter controls whether integrations should capture HTTP request bodies.
207
207
208
208
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.
209
209
210
-
<SdkOptionname="integrations">
210
+
<SdkOptionname="integrations"type="array">
211
211
212
212
In some SDKs, the integrations are configured through this parameter on library initialization. For more information, please see our documentation for a specific integration.
213
213
@@ -217,15 +217,15 @@ In some SDKs, the integrations are configured through this parameter on library
217
217
218
218
These options can be used to hook the SDK in various ways to customize the reporting of events.
219
219
220
-
<SdkOptionname="beforeSend">
220
+
<SdkOptionname="beforeSend"type="function">
221
221
222
222
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.
223
223
224
224
By the time <PlatformIdentifiername="beforeSend" /> is executed, all scope data has already been applied to the event. Further modification of the scope won't have any effect.
225
225
226
226
</SdkOption>
227
227
228
-
<SdkOptionname="beforeBreadcrumb">
228
+
<SdkOptionname="beforeBreadcrumb"type="function">
229
229
230
230
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.
231
231
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.
@@ -236,27 +236,27 @@ The callback typically gets a second argument (called a "hint") which contains t
236
236
237
237
Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments.
238
238
239
-
<SdkOptionname="transport">
239
+
<SdkOptionname="transport"type="function">
240
240
241
241
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.
242
242
243
243
</SdkOption>
244
244
245
245
## Tracing Options
246
246
247
-
<SdkOptionname="tracesSampleRate">
247
+
<SdkOptionname="tracesSampleRate"type="float">
248
248
249
249
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 <PlatformIdentifiername="tracesSampler" /> must be defined to enable tracing.
250
250
251
251
</SdkOption>
252
252
253
-
<SdkOptionname="tracesSampler">
253
+
<SdkOptionname="tracesSampler"type="function">
254
254
255
255
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 <PlatformIdentifiername="tracesSampleRate" /> must be defined to enable tracing.
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.
262
262
@@ -270,59 +270,59 @@ If <PlatformIdentifier name="tracePropagationTargets" /> is not provided, trace
270
270
271
271
## Experimental Features
272
272
273
-
<SdkOptionname="experimental">
273
+
<SdkOptionname="experimental"type="object">
274
274
275
275
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.
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.
284
284
285
285
You should follow the [guide to native initialization](/platforms/dart/guides/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 `true` to enable reporting [FlutterErrorDetails.silent](https://api.flutter.dev/flutter/foundation/FlutterErrorDetails/silent.html) errors automatically.
0 commit comments