SentryOptions class

Sentry SDK options

Constructors

SentryOptions({String? dsn, PlatformChecker? checker})
SentryOptions.empty()

Properties

attachStacktrace bool
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.
getter/setter pair
attachThreads bool
When enabled, the current isolate will be attached to the event. This only applies to Dart:io platforms and only the current isolate. The Dart runtime doesn't provide information about other active isolates.
getter/setter pair
automatedTestMode bool
Only for internal use. Changed SDK behaviour when set to true:
getter/setter pair
beforeBreadcrumb BeforeBreadcrumbCallback?
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
getter/setter pair
beforeMetricCallback BeforeMetricCallback?
This function is called right before a metric is about to be emitted. Can return true to emit the metric, or false to drop it.
getter/setter pair
beforeSend BeforeSendCallback?
This function is called with an SDK specific event object and can return a modified event object or nothing to skip reporting the event
getter/setter pair
beforeSendFeedback BeforeSendCallback?
This function is called with an SDK specific feedback event object and can return a modified feedback event object or nothing to skip reporting the feedback event
getter/setter pair
beforeSendTransaction BeforeSendTransactionCallback?
This function is called with an SDK specific transaction object and can return a modified transaction object or nothing to skip reporting the transaction
getter/setter pair
captureFailedRequests bool
Configures whether to record exceptions for failed requests. Examples for captures exceptions are:
getter/setter pair
clock ClockProvider
If clock is provided, it is used to get time instead of the system clock. This is useful in tests. Should be an implementation of ClockProvider. The ClockProvider is expected to return UTC time.
getter/setter pair
compressPayload bool
If compressPayload is true the outgoing HTTP payloads are compressed using gzip. Otherwise, the payloads are sent in plain UTF8-encoded JSON text. The compression is enabled by default.
getter/setter pair
considerInAppFramesByDefault bool
Configures whether stack trace frames are considered in app frames by default. You can use this to essentially make inAppIncludes or inAppExcludes an allow or deny list. This value is only used if Sentry can not find the origin of the frame.
getter/setter pair
debug bool
Turns debug mode on or off. If debug is enabled SDK will attempt to print out useful debugging information if something goes wrong. Default is disabled.
getter/setter pair
diagnosticLevel SentryLevel
minimum LogLevel to be used if debug is enabled
getter/setter pair
dist String?
Sets the distribution. Think about it together with release and environment
getter/setter pair
dsn String?
The DSN tells the SDK where to send the events to. If an empty string is used, the SDK will not send any events.
getter/setter pair
enableDartSymbolication bool
Enables Dart symbolication for stack traces in Flutter.
getter/setter pair
enableDeduplication bool
Whether SentryEvent deduplication is enabled. Can be further configured with maxDeduplicationItems. Shoud be set to true if SentryHttpClient is used to capture failed requests.
getter/setter pair
enableDefaultTagsForMetrics bool
Enables enriching metrics with default tags. Requires enableMetrics. More on https://develop.sentry.dev/delightful-developer-metrics/sending-metrics-sdk/#automatic-tags-extraction Currently adds release, environment and transaction name.
getter/setter pair
enableExceptionTypeIdentification bool
Enables identification of exception types in obfuscated builds. When true, the SDK will attempt to identify common exception types to improve readability of obfuscated issue titles.
getter/setter pair
enableMetrics bool
Enables sending developer metrics to Sentry. More on https://develop.sentry.dev/delightful-developer-metrics/. Example:
getter/setter pair
enablePrintBreadcrumbs bool
Enable this option if you want to record calls to print() as breadcrumbs. In a Flutter environment, this setting also toggles recording of debugPrint calls. debugPrint calls are only recorded in release builds, though.
getter/setter pair
enableScopeSync bool
If enabled, scopeObservers will be called when mutating scope.
getter/setter pair
enableSpanLocalMetricAggregation bool
Enables span metrics aggregation. Requires enableMetrics. More on https://develop.sentry.dev/sdk/metrics/#span-aggregation
getter/setter pair
enableTracing bool?
Enables generation of transactions and propagation of trace data. If set to null, tracing might be enabled if tracesSampleRate or tracesSampler are set.
getter/setter pair
environment String?
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. See docs for further information
getter/setter pair
environmentVariables ↔ EnvironmentVariables
If environmentVariables is provided, it is used get the environment variables. This is useful in tests.
getter/setter pair
eventProcessors List<EventProcessor>
Are callbacks that run for every event. They can either return a new event which in most cases means just adding data OR return null in case the event will be dropped and not sent.
no setter
exceptionFactory ↔ SentryExceptionFactory
getter/setter pair
exceptionTypeIdentifiers List<ExceptionTypeIdentifier>
no setter
hashCode int
The hash code for this object.
no setterinherited
httpClient ↔ Client
If httpClient is provided, it is used instead of the default client to make HTTP calls to Sentry.io. This is useful in tests. If you don't need to send events, use NoOpClient.
getter/setter pair
idleTimeout Duration?
The idle time to wait until the transaction will be finished. The transaction will use the end timestamp of the last finished span as the endtime for the transaction.
getter/setter pair
ignoredExceptionsForType List<Type>
Ignored exception types.
no setter
ignoreErrors List<String>
The ignoreErrors tells the SDK which errors should be not sent to the sentry server. If an null or an empty list is used, the SDK will send all transactions. To use regex add the ^ and the $ to the string.
getter/setter pair
ignoreTransactions List<String>
The ignoreTransactions tells the SDK which transactions should be not sent to the sentry server. If null or an empty list is used, the SDK will send all transactions. To use regex add the ^ and the $ to the string.
getter/setter pair
inAppExcludes List<String>
A list of string prefixes of packages names that do not belong to the app, but rather third-party packages. Packages considered not to be part of the app will be hidden from stack traces by default. example : ['sentry'] will exclude exception from package:sentry/sentry.dart
no setter
inAppIncludes List<String>
A list of string prefixes of packages names that belong to the app. This option takes precedence over inAppExcludes. example: ['sentry'] will include exception from package:sentry/sentry.dart
no setter
integrations List<Integration<SentryOptions>>
Code that provides middlewares, bindings or hooks into certain frameworks or environments, along with code that inserts those bindings and activates them.
no setter
logger SentryLogger
Logger interface to log useful debugging information if debug is enabled
getter/setter pair
markAutomaticallyCollectedErrorsAsFatal bool
Errors that the SDK automatically collects, for example in SentryIsolate, have level SentryLevel.fatal set per default. Settings this to false will set the level to SentryLevel.error.
getter/setter pair
maxAttachmentSize int
Maximum allowed file size of attachments, in bytes. Attachments above this size will be discarded
getter/setter pair
maxBreadcrumbs int
This variable controls the total amount of breadcrumbs that should be captured Default is 100
getter/setter pair
maxDeduplicationItems int
Describes how many exceptions are kept to be checked for deduplication. This should be a small positiv integer in order to keep deduplication performant. Is only in effect if enableDeduplication is set to true.
getter/setter pair
maxQueueSize int
Returns the max number of events Sentry will send when calling capture methods in a tight loop. Default is 30.
getter/setter pair
maxRequestBodySize MaxRequestBodySize
Configures up to which size request bodies should be included in events. This does not change whether an event is captured.
getter/setter pair
maxResponseBodySize MaxResponseBodySize
Configures up to which size response bodies should be included in events. This does not change whether an event is captured.
getter/setter pair
maxSpans int
Returns the maximum number of spans that can be attached to single transaction.
getter/setter pair
parsedDsn Dsn
Evaluates and parses the DSN. May throw an exception if the DSN is invalid.
no setter
performanceCollectors List<PerformanceCollector>
no setter
platformChecker PlatformChecker
If platformChecker is provided, it is used get the environment. This is useful in tests. Should be an implementation of PlatformChecker.
getter/setter pair
profilesSampleRate double?
getter/setter pair
proxy SentryProxy?
Configure a proxy to use for SDK API calls.
getter/setter pair
recorder ↔ ClientReportRecorder
getter/setter pair
recordHttpBreadcrumbs bool
Whether to records requests as breadcrumbs. This is on by default. It only has an effect when the SentryHttpClient or dio integration is in use, or iOS native where it sets the value to enableNetworkBreadcrumbs.
getter/setter pair
release String?
Sets the release. SDK will try to automatically configure a release out of the box See docs for further information
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sampleRate double?
Configures the sample rate as a percentage of events to be sent in the range of 0.0 to 1.0. if 1.0 is set it means that 100% of events are sent. If set to 0.1 only 10% of events will be sent. Events are picked randomly. Default is null (disabled)
getter/setter pair
scopeObservers List<ScopeObserver>
no setter
sdk SdkVersion
Sdk object that contains the Sentry Client Name and its version
getter/setter pair
sendClientReports bool
Send statistics to sentry when the client drops events.
getter/setter pair
sendDefaultPii bool
Whether to send personal identifiable information along with events
getter/setter pair
sentryClientName String
Sentry client name used for the HTTP authHeader and userAgent eg sentry.{language}.{platform}/{version} eg sentry.java.android/2.0.0 would be a valid case
no setter
serverName String?
The server name used in the Sentry messages.
getter/setter pair
spotlight Spotlight
The Spotlight configuration. Disabled by default.
getter/setter pair
stackTraceFactory ↔ SentryStackTraceFactory
getter/setter pair
tracePropagationTargets List<String>
List of strings/regex controlling to which outgoing requests the SDK will attach tracing headers.
final
tracesSampler TracesSamplerCallback?
This function is called by TracesSamplerCallback to determine if transaction is sampled - meant to be sent to Sentry.
getter/setter pair
tracesSampleRate double?
Returns the traces sample rate Default is null (disabled)
getter/setter pair
transport Transport
The transport is an internal construct of the client that abstracts away the event sending.
getter/setter pair

Methods

addEventProcessor(EventProcessor eventProcessor) → void
Adds an event processor
addExceptionCauseExtractor(ExceptionCauseExtractor extractor) → void
Adds ExceptionCauseExtractor in order to extract inner exceptions
addExceptionFilterForType(Type exceptionType) → void
Adds exception type to the list of ignored exceptions.
addExceptionStackTraceExtractor(ExceptionStackTraceExtractor extractor) → void
Adds ExceptionStackTraceExtractor in order to extract inner exceptions
addExceptionTypeIdentifierByIndex(int index, ExceptionTypeIdentifier exceptionTypeIdentifier) → void
addInAppExclude(String inApp) → void
Adds an inAppExclude
addInAppInclude(String inApp) → void
Adds an inAppIncludes
addIntegration(Integration<SentryOptions> integration) → void
Adds an integration
addIntegrationByIndex(int index, Integration<SentryOptions> integration) → void
Adds an integration in the given index
addPerformanceCollector(PerformanceCollector collector) → void
addScopeObserver(ScopeObserver scopeObserver) → void
containsIgnoredExceptionForType(dynamic exception) bool
Check if ignoredExceptionsForType contains an exception.
exceptionCauseExtractor(Type type) ExceptionCauseExtractor?
Returns a previously added ExceptionCauseExtractor by type
exceptionStackTraceExtractor(Type type) ExceptionStackTraceExtractor?
Returns a previously added ExceptionStackTraceExtractor by type
isTracingEnabled() bool
Returns if tracing should be enabled. If tracing is disabled, starting transactions returns NoOpSentrySpan.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prependExceptionTypeIdentifier(ExceptionTypeIdentifier exceptionTypeIdentifier) → void
Adds an exception type identifier to the beginning of the list. This ensures it is processed first and takes precedence over existing identifiers.
removeEventProcessor(EventProcessor eventProcessor) → void
Removes an event processor
removeIntegration(Integration<SentryOptions> integration) → void
Removes an integration
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited