Sentry class

Sentry SDK main entry point

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

isEnabled bool
Check if the current Hub is enabled/active.
no setter
lastEventId SentryId
Last event id recorded by the current Hub
no setter
logger SentryLogger
no setter
metrics SentryMetrics
no setter

Static Methods

addBreadcrumb(Breadcrumb crumb, {Hint? hint}) Future<void>
Adds a breadcrumb to the current Scope
addFeatureFlag(String flag, dynamic result) Future<void>
bindClient(SentryClient client) → void
Binds a different client to the current hub
captureEvent(SentryEvent event, {dynamic stackTrace, Hint? hint, ScopeCallback? withScope}) Future<SentryId>
Reports an event to Sentry.io.
captureException(dynamic throwable, {dynamic stackTrace, Hint? hint, SentryMessage? message, ScopeCallback? withScope}) Future<SentryId>
Reports the throwable and optionally its stackTrace to Sentry.io.
captureFeedback(SentryFeedback feedback, {Hint? hint, ScopeCallback? withScope}) Future<SentryId>
Reports SentryFeedback to Sentry.io.
captureMessage(String? message, {SentryLevel? level = SentryLevel.info, String? template, List? params, Hint? hint, ScopeCallback? withScope}) Future<SentryId>
Reports a message to Sentry.io.
clone() Hub
Clones the current Hub
close() Future<void>
Close the client SDK
configureScope(ScopeCallback callback) FutureOr<void>
Configures the scope through the callback.
getSpan() ISentrySpan?
Gets the current active transaction or span bound to the scope. Returns null if performance is disabled in the options.
init(OptionsConfiguration optionsConfiguration, {AppRunner? appRunner, bool callAppRunnerInRunZonedGuarded = true, RunZonedGuardedOnError? runZonedGuardedOnError, SentryOptions? options}) Future<void>
Initializes the SDK passing a AppRunner callback allows to run the app within its own error zone (runZonedGuarded)
removeAttribute(String key) → void
Removes the attribute key from the scope.
runZonedGuarded<R>(R body(), void onError(Object error, StackTrace stack)?, {Map<Object?, Object?>? zoneValues, ZoneSpecification? zoneSpecification}) → dynamic
Creates a new error handling zone with Sentry integration using runZonedGuarded.
setAttributes(Map<String, SentryAttribute> attributes) → void
Adds attributes to the current Scope. These attributes will be applied to logs. When the same attribute keys exist on the current log, it takes precedence over an attribute with the same key set on any scope.
startInactiveSpan(String name, {Map<String, SentryAttribute>? attributes, SentrySpanV2? parentSpan = const UnsetSentrySpanV2()}) SentrySpanV2
Creates a span that is not set as the active span.
startSpan<T>(String name, Future<T> callback(SentrySpanV2 span), {Map<String, SentryAttribute>? attributes, SentrySpanV2? parentSpan = const UnsetSentrySpanV2(), DateTime? startTimestamp}) Future<T>
Starts a new span, executes an async callback, and ends the span automatically when the returned future completes.
startSpanSync<T>(String name, T callback(SentrySpanV2 span), {Map<String, SentryAttribute>? attributes, SentrySpanV2? parentSpan = const UnsetSentrySpanV2(), DateTime? startTimestamp}) → T
Starts a new span, executes a synchronous callback, and ends the span before returning the callback result.
startTransaction(String name, String operation, {String? description, DateTime? startTimestamp, bool? bindToScope, bool? waitForChildren, Duration? autoFinishAfter, bool? trimEnd, OnTransactionFinish? onFinish, Map<String, dynamic>? customSamplingContext}) ISentrySpan
Creates a Transaction and returns the instance.
startTransactionWithContext(SentryTransactionContext transactionContext, {Map<String, dynamic>? customSamplingContext, DateTime? startTimestamp, bool? bindToScope, bool? waitForChildren, Duration? autoFinishAfter, bool? trimEnd, OnTransactionFinish? onFinish}) ISentrySpan
Creates a Transaction and returns the instance.