sentry library

A pure Dart client for Sentry.io crash reporting.

Classes

Structured data to describe more information prior to the event captured. See Sentry.captureEvent().
CachingExceptionTypeIdentifier
Contexts
The context interfaces provide additional context data.
CustomSentryMeasurementUnit
Custom units without builtin conversion. No formatting will be applied to the measurement value in the Sentry product, and the value with the unit will be shown as is.
DebugImage
The list of debug images contains all dynamic libraries loaded into the process and their memory addresses. Instruction addresses in the Stack Trace are mapped into the list of debug images in order to retrieve debug files for symbolication. There are two kinds of debug images: Native debug images with types macho, elf, and pe Android debug images with type proguard more details : https://develop.sentry.dev/sdk/event-payloads/debugmeta/
DebugMeta
The debug meta interface carries debug information for processing errors and crash reports.
Dsn
The Data Source Name (DSN) tells the SDK where to send the events
EventProcessor
EventProcessors 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.
ExceptionCause
Holds inner exception and stackTrace combinations contained in other exceptions
ExceptionCauseExtractor<T>
Extend this abstract class and return inner ExceptionCause of your exceptions.
ExceptionStackTraceExtractor<T>
Sentry handles Error.stackTrace by default. For other cases extend this abstract class and return a custom StackTrace of your exceptions.
ExceptionTypeIdentifier
An abstract class for identifying the type of Dart errors and exceptions.
Hint
Hints are used in BeforeSendCallback, BeforeBreadcrumbCallback and event processors.
HttpHeaderUtils
Helper to extract header data
HttpSanitizer
Hub
SDK API contract which combines a client and scope management
HubAdapter
Hub adapter to make Integrations testable
Integration<T extends SentryOptions>
Code that provides middlewares, bindings or hooks into certain frameworks or environments, along with code that inserts those bindings and activates them.
ISentrySpan
Represents performance monitoring Span.
IsolateErrorIntegration
NoOp web integration : isolate doesnt' work in browser
Mechanism
Sentry Exception Mechanism The exception mechanism is an optional field residing in the Exception Interface. It carries additional information about the way the exception was created on the target system. This includes general exception values obtained from operating system or runtime APIs, as well as mechanism-specific values.
MetricSummary
NoneSentryMeasurementUnit
Untyped value.
NoOpSentrySpan
PerformanceCollector
PerformanceContinuousCollector
Used for collecting continuous data about vitals (slow, frozen frames, etc.) during a transaction/span.
PlatformChecker
Helper to check in which enviroment the library is running. The envirment checks (release/debug/profile) are mutually exclusive.
RunZonedGuardedIntegration
Integration that runs runner function within runZonedGuarded and capture errors on the runZonedGuarded error handler. See https://api.dart.dev/stable/dart-async/runZonedGuarded.html
Scope
Scope data to be sent with the event
ScopeObserver
SdkInfo
An object describing the system SDK.
SdkVersion
Describes the SDK that is submitting events to Sentry.
Sentry
Sentry SDK main entry point
SentryApp
App context describes the application.
SentryAttachment
Arbitrary content which gets attached to an event.
SentryBaggage
SentryBaggageHeader
SentryBrowser
Carries information about the browser or user agent for web-related errors.
SentryClient
Logs crash reports and events to the Sentry.io service.
SentryCulture
Culture Context describes certain properties of the culture in which the software is used.
SentryDevice
This describes the device that caused the event.
SentryEnvelope
Class representation of Envelope file.
SentryEnvelopeItem
Item holding header information and JSON encoded data.
SentryEvent
An event to be reported to Sentry.io.
SentryException
The Exception Interface specifies an exception or error that occurred in a program.
SentryFeedback
SentryGeo
Geographical location of the end user or device.
SentryGpu
GPU context describes the GPU of the device.
SentryHttpClient
A http-package compatible HTTP client.
SentryId
Hexadecimal string representing a uuid4 value. The length is exactly 32 characters. Dashes are not allowed. Has to be lowercase.
SentryLevel
Severity of the logged Event.
SentryMeasurement
SentryMeasurementUnit
The unit of measurement of a metric value. Units augment metric values by giving them a magnitude and semantics. Units and their precisions are uniquely represented by a string identifier.
SentryMessage
The Message Interface carries a log message that describes an event or error. Optionally, it can carry a format string and structured parameters. This can help to group similar messages into the same issue. example of a serialized message:
SentryOperatingSystem
Describes the operating system on which the event was created.
SentryOptions
Sentry SDK options
SentryPackage
A SentryPackage part of the SDK.
SentryProxy
SentryRequest
The Request interface contains information on a HTTP request related to the event. In client SDKs, this can be an outgoing request, or the request that rendered the current web page. On server SDKs, this could be the incoming web request that is being handled.
SentryResponse
The response interface contains information on a HTTP request related to the event.
SentryRuntime
Describes a runtime in more detail.
SentrySamplingContext
Context used by TracesSamplerCallback to determine if transaction is going to be sampled.
SentrySpan
SentrySpanContext
SentrySpanOperations
SentryStackFrame
Frames belong to a StackTrace It should contain at least a filename, function or instruction_addr
SentryStackTrace
Stacktrace holds information about the frames of the stack.
SentryStatusCode
SentryThread
The Threads Interface specifies threads that were running at the time an event happened. These threads can also contain stack traces. See https://develop.sentry.dev/sdk/event-payloads/threads/
SentryTraceContext
SentryTraceContextHeader
SentryTraceHeader
Represents HTTP header "sentry-trace".
SentryTraceOrigins
SentryTracesSamplingDecision
SentryTransaction
SentryTransactionContext
SentryTransactionInfo
SentryUser
Describes the current user associated with the application, such as the currently signed in user.
SentryUserFeedback
SentryViewHierarchy
SentryViewHierarchyElement
SpanDataConvention
SpanId
The length is exactly 16 characters. Dashes are not allowed. Has to be lowercase.
SpanStatus
The Span statuses
Spotlight
Spotlight configuration class.
Transport
A transport is in charge of sending the event/envelope either via http or caching in the disk.
TypeCheckHint
Constants used for Type Check hints.
UnsupportedThrowablesHandler
A handler for unsupported throwables used for Expando
UrlDetails
Sanitized url data for sentry.io

Enums

DurationSentryMeasurementUnit
FractionSentryMeasurementUnit
InformationSentryMeasurementUnit
MaxRequestBodySize
Describes the size of http request bodies which should be added to an event
MaxResponseBodySize
Describes the size of http response bodies which should be added to an event This enum might be removed at any time.
SentryOrientation
If a device is on portrait or landscape mode
SentryProxyType
SentryTransactionNameSource

Mixins

SentryEventLike<T>
A SentryEventLike mixin that is extended by SentryEvent and SentryTransaction

Properties

utf8JsonEncoder JsonUtf8Encoder
final

Functions

addBaggageHeader(SentryBaggageHeader baggage, Map<String, dynamic> headers, {SentryLogger? logger}) → void
addBaggageHeaderFromSpan(ISentrySpan span, Map<String, dynamic> headers, {SentryLogger? logger}) → void
addSentryTraceHeader(SentryTraceHeader traceHeader, Map<String, dynamic> headers) → void
addSentryTraceHeaderFromSpan(ISentrySpan span, Map<String, dynamic> headers) → void
containsTargetOrMatchesRegExp(List<String> tracePropagationTargets, String url) bool
dartLogger(SentryLevel level, String message, {String? logger, Object? exception, StackTrace? stackTrace}) → void
A Logger that prints out the level and message
formatDateAsIso8601WithMillisPrecision(DateTime date) String
Formats a Date as ISO8601 and UTC with millis precision
getUtcDateTime() DateTime
Sentry does not take a timezone and instead expects the date-time to be submitted in UTC timezone.
isValidSampleRate(double? sampleRate) bool
jsonSerializationFallback(Object? nonEncodable) Object?
noOpLogger(SentryLevel level, String message, {String? logger, Object? exception, StackTrace? stackTrace}) → void
A NoOp logger that does nothing

Typedefs

AppRunner = FutureOr<void> Function()
Runs a callback inside of the runZonedGuarded method, useful for running your runApp(MyApp())
BeforeBreadcrumbCallback = Breadcrumb? Function(Breadcrumb? breadcrumb, Hint hint)
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
BeforeMetricCallback = bool Function(String key, {Map<String, String>? tags})
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.
BeforeSendCallback = FutureOr<SentryEvent?> Function(SentryEvent event, Hint hint)
This function is called with an SDK specific event object and can return a modified event object or nothing to skip reporting the event
BeforeSendTransactionCallback = FutureOr<SentryTransaction?> Function(SentryTransaction transaction)
This function is called with an SDK specific transaction object and can return a modified transaction object or nothing to skip reporting the transaction
ClockProvider = DateTime Function()
Used to provide timestamp for logging.
ContentLoader = FutureOr<Uint8List> Function()
OnFinishedCallback = Future<void> Function({DateTime? endTimestamp})
OnTransactionFinish = FutureOr<void> Function(ISentrySpan transaction)
Called when a transaction is finished.
OptionsConfiguration = FutureOr<void> Function(SentryOptions)
Configuration options callback
RunZonedGuardedOnError = FutureOr<void> Function(Object, StackTrace)
Caught exception and stacktrace in runZonedGuarded
RunZonedGuardedRunner = Future<void> Function()
Called inside of runZonedGuarded
ScopeCallback = FutureOr<void> Function(Scope)
Configures the scope through the callback.
SentryLogger = void Function(SentryLevel level, String message, {Object? exception, String? logger, StackTrace? stackTrace})
Logger interface to log useful debugging information if debug is enabled
TracesSamplerCallback = double? Function(SentrySamplingContext samplingContext)

Exceptions / Errors

InvalidSentryTraceHeaderException
SentryHttpClientError
ThrowableMechanism
A decorator that holds a Mechanism related to the decorated Exception