HubAdapter class

Hub adapter to make Integrations testable

Implemented types

Constructors

HubAdapter()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
isEnabled bool
Check if the Hub is enabled/active.
no setteroverride
lastEventId SentryId
Last event id recorded by the Hub
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scope Scope
no setter

Methods

addBreadcrumb(Breadcrumb crumb, {Hint? hint}) Future<void>
Adds a breadcrumb to the current Scope
override
bindClient(SentryClient client) → void
Binds a different client to the hub
override
captureEvent(SentryEvent event, {dynamic stackTrace, Hint? hint, ScopeCallback? withScope}) Future<SentryId>
Captures the event.
override
captureException(dynamic throwable, {dynamic stackTrace, Hint? hint, SentryMessage? message, ScopeCallback? withScope}) Future<SentryId>
Captures the exception
override
captureFeedback(SentryFeedback feedback, {Hint? hint, ScopeCallback? withScope}) Future<SentryId>
Captures the feedback.
override
captureLog(SentryLog log) FutureOr<void>
override
captureMessage(String? message, {SentryLevel? level, String? template, List? params, Hint? hint, ScopeCallback? withScope}) Future<SentryId>
Captures the message.
override
captureMetric(SentryMetric metric) Future<void>
override
captureSpan(SentrySpanV2 span) Future<void>
override
captureTransaction(SentryTransaction transaction, {SentryTraceContextHeader? traceContext, Hint? hint}) Future<SentryId>
clone() Hub
Clones the Hub
override
close() Future<void>
Flushes out the queue for up to timeout seconds and disable the Hub.
override
configureScope(ScopeCallback callback) FutureOr<void>
Configures the scope through the callback.
override
generateNewTrace() → void
getActiveSpan() RecordingSentrySpanV2?
Returns the currently active span, or null if no span is in progress.
getSpan() ISentrySpan?
Gets the current active transaction or span.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAttribute(String key) → void
override
setAttributes(Map<String, SentryAttribute> attributes) → void
override
setSpanContext(dynamic throwable, ISentrySpan span, String transaction) → void
startIdleSpan(String name, {Duration idleTimeout = const Duration(seconds: 3), Duration finalTimeout = const Duration(seconds: 30), bool trimIdleSpanEndTimestamp = true, bool bindToHub = true, Map<String, SentryAttribute>? attributes, DateTime? startTimestamp}) SentrySpanV2
Starts an idle root span. Idle spans are always root spans and are never children of another span.
startInactiveSpan(String name, {Map<String, SentryAttribute>? attributes, SentrySpanV2? parentSpan = const UnsetSentrySpanV2(), DateTime? startTimestamp}) SentrySpanV2
override
startSpan<T>(String name, Future<T> callback(SentrySpanV2 span), {Map<String, SentryAttribute>? attributes, SentrySpanV2? parentSpan = const UnsetSentrySpanV2(), DateTime? startTimestamp}) Future<T>
override
startSpanSync<T>(String name, T callback(SentrySpanV2 span), {Map<String, SentryAttribute>? attributes, SentrySpanV2? parentSpan = const UnsetSentrySpanV2(), DateTime? startTimestamp}) → T
override
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.
override
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.
override
toString() String
A string representation of this object.
inherited

Operators

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