Class HubAdapter
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBreadcrumb(@NotNull Breadcrumb breadcrumb) Deprecated.Adds a breadcrumb to the current ScopevoidaddBreadcrumb(@NotNull Breadcrumb breadcrumb, @Nullable Hint hint) Deprecated.Adds a breadcrumb to the current ScopevoidbindClient(@NotNull ISentryClient client) Deprecated.Binds a different client to the scopes@NotNull SentryIdcaptureCheckIn(@NotNull CheckIn checkIn) Deprecated.@NotNull SentryIdcaptureEnvelope(@NotNull SentryEnvelope envelope, @Nullable Hint hint) Deprecated.Captures an envelope.@NotNull SentryIdcaptureEvent(@NotNull SentryEvent event, @Nullable Hint hint) Deprecated.Captures the event.@NotNull SentryIdcaptureEvent(@NotNull SentryEvent event, @Nullable Hint hint, @NotNull ScopeCallback callback) Deprecated.Captures the event.@NotNull SentryIdcaptureException(@NotNull Throwable throwable, @Nullable Hint hint) Deprecated.Captures the exception.@NotNull SentryIdcaptureException(@NotNull Throwable throwable, @Nullable Hint hint, @NotNull ScopeCallback callback) Deprecated.Captures the exception.@NotNull SentryIdcaptureFeedback(@NotNull Feedback feedback) Deprecated.Captures the feedback.@NotNull SentryIdcaptureFeedback(@NotNull Feedback feedback, @Nullable Hint hint) Deprecated.Captures the feedback.@NotNull SentryIdcaptureFeedback(@NotNull Feedback feedback, @Nullable Hint hint, @Nullable ScopeCallback callback) Deprecated.Captures the feedback.@NotNull SentryIdcaptureMessage(@NotNull String message, @NotNull SentryLevel level) Deprecated.Captures the message.@NotNull SentryIdcaptureMessage(@NotNull String message, @NotNull SentryLevel level, @NotNull ScopeCallback callback) Deprecated.Captures the message.@NotNull SentryIdcaptureProfileChunk(@NotNull ProfileChunk profilingContinuousData) Deprecated.Captures the profile chunk and enqueues it for sending to Sentry server.@NotNull SentryIdcaptureReplay(@NotNull SentryReplayEvent replay, @Nullable Hint hint) Deprecated.@NotNull SentryIdcaptureTransaction(@NotNull SentryTransaction transaction, @Nullable TraceContext traceContext, @Nullable Hint hint, @Nullable ProfilingTraceData profilingTraceData) Deprecated.Captures the transaction and enqueues it for sending to Sentry server.voidcaptureUserFeedback(@NotNull UserFeedback userFeedback) Deprecated.Captures a manually created user feedback and sends it to Sentry.voidDeprecated.Deletes current breadcrumbs from the current scope.@NotNull IHubclone()Deprecated.please useIScopes.forkedScopes(String)orIScopes.forkedCurrentScope(String)instead.voidclose()Deprecated.Flushes out the queue for up to timeout seconds and disable the Scopes.voidclose(boolean isRestarting) Deprecated.Flushes out the queue for up to timeout seconds and disable the Scopes.voidconfigureScope(@Nullable ScopeType scopeType, @NotNull ScopeCallback callback) Deprecated.Configures the scope through the callback.@Nullable TransactionContextcontinueTrace(@Nullable String sentryTrace, @Nullable List<String> baggageHeaders) Deprecated.Continue a trace based on HTTP header values.voidDeprecated.Ends the current sessionvoidflush(long timeoutMillis) Deprecated.Flushes events queued up, but keeps the scopes enabled.@NotNull IScopesforkedCurrentScope(@NotNull String creator) Deprecated.Creates a fork of current scope without forking isolation scope.@NotNull IScopesforkedRootScopes(@NotNull String creator) Deprecated.Creates a fork of both current and isolation scope from root scopes.@NotNull IScopesforkedScopes(@NotNull String creator) Deprecated.Creates a fork of both current and isolation scope from current scopes.@Nullable BaggageHeaderDeprecated.Returns the "baggage" header that allows tracing across services.@NotNull IScopeDeprecated.Returns the global scope.static HubAdapterDeprecated.@NotNull IScopeDeprecated.Returns the isolation scope of this Scopes.@NotNull SentryIdDeprecated.Last event id recorded in the current scope@NotNull SentryOptionsDeprecated.Gets theSentryOptionsattached to current scope.@Nullable IScopesDeprecated.Returns the parent of this Scopes instance or null, if it does not have a parent.@Nullable RateLimiterDeprecated.@NotNull IScopegetScope()Deprecated.Returns the current scope of this Scopes.@Nullable ISpangetSpan()Deprecated.Gets the current active transaction or span.@Nullable SentryTraceHeaderDeprecated.Returns the "sentry-trace" header that allows tracing across services.@Nullable ITransactionDeprecated.Returns the transaction.booleanisAncestorOf(@Nullable IScopes otherScopes) Deprecated.Checks whether this Scopes instance is direct or indirect parent of the other Scopes instance.@Nullable BooleanDeprecated.Returns if the App has crashed (Process has terminated) during the last run.booleanDeprecated.Check if Sentry is enabled/active.booleanDeprecated.Whether the transport is healthy.@NotNull ILoggerApilogger()Deprecated.@NotNull ISentryLifecycleTokenDeprecated.Stores this Scopes in store, making it the current one that is used by static API.voidpopScope()Deprecated.please callISentryLifecycleToken.close()on the token returned byScopesAdapter.pushScope()orScopesAdapter.pushIsolationScope()instead.@NotNull ISentryLifecycleTokenDeprecated.@NotNull ISentryLifecycleTokenDeprecated.Pushes a new scope while inheriting the current scope's data.voidremoveExtra(@Nullable String key) Deprecated.Removes the extra key to an arbitrary value to the current ScopevoidDeprecated.Removes the tag to a string value to the current ScopevoidDeprecated.Report a screen has been fully loaded.voidsetActiveSpan(@Nullable ISpan span) Deprecated.voidDeprecated.Sets the extra key to an arbitrary value to the current Scope, overwriting a potential previous valuevoidsetFingerprint(@NotNull List<String> fingerprint) Deprecated.Sets the fingerprint to group specific events together to the current Scope.voidsetLevel(@Nullable SentryLevel level) Deprecated.Sets the level of all events sent within current ScopevoidsetSpanContext(@NotNull Throwable throwable, @NotNull ISpan span, @NotNull String transactionName) voidDeprecated.Sets the tag to a string value to the current Scope, overwriting a potential previous valuevoidsetTransaction(@Nullable String transaction) Deprecated.Sets the name of the current transaction to the current Scope.voidDeprecated.Shallow merges user configuration (email, username, etc) to the current Scope.voidDeprecated.voidDeprecated.Starts a new session.@NotNull ITransactionstartTransaction(@NotNull TransactionContext transactionContext, @NotNull TransactionOptions transactionOptions) Deprecated.Creates a Transaction and returns the instance.voidDeprecated.voidwithIsolationScope(@NotNull ScopeCallback callback) Deprecated.Runs the callback with a new isolation scope which gets dropped at the end.voidwithScope(@NotNull ScopeCallback callback) Deprecated.Runs the callback with a new current scope which gets dropped at the end.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.sentry.IScopes
addBreadcrumb, addBreadcrumb, captureEnvelope, captureEvent, captureEvent, captureException, captureException, captureMessage, captureMessage, captureTransaction, captureTransaction, captureTransaction, configureScope, isNoOp, startTransaction, startTransaction, startTransaction
-
Method Details
-
getInstance
Deprecated. -
isEnabled
public boolean isEnabled()Deprecated.Description copied from interface:IScopesCheck if Sentry is enabled/active. -
captureEvent
@NotNull public @NotNull SentryId captureEvent(@NotNull @NotNull SentryEvent event, @Nullable @Nullable Hint hint) Deprecated.Description copied from interface:IScopesCaptures the event.- Specified by:
captureEventin interfaceIScopes- Parameters:
event- the eventhint- SDK specific but provides high level information about the origin of the event- Returns:
- The Id (SentryId object) of the event
-
captureEvent
@NotNull public @NotNull SentryId captureEvent(@NotNull @NotNull SentryEvent event, @Nullable @Nullable Hint hint, @NotNull @NotNull ScopeCallback callback) Deprecated.Description copied from interface:IScopesCaptures the event.- Specified by:
captureEventin interfaceIScopes- Parameters:
event- the eventhint- SDK specific but provides high level information about the origin of the eventcallback- The callback to configure the scope for a single invocation.- Returns:
- The Id (SentryId object) of the event
-
captureMessage
@NotNull public @NotNull SentryId captureMessage(@NotNull @NotNull String message, @NotNull @NotNull SentryLevel level) Deprecated.Description copied from interface:IScopesCaptures the message.- Specified by:
captureMessagein interfaceIScopes- Parameters:
message- The message to send.level- The message level.- Returns:
- The Id (SentryId object) of the event
-
captureMessage
@NotNull public @NotNull SentryId captureMessage(@NotNull @NotNull String message, @NotNull @NotNull SentryLevel level, @NotNull @NotNull ScopeCallback callback) Deprecated.Description copied from interface:IScopesCaptures the message.- Specified by:
captureMessagein interfaceIScopes- Parameters:
message- The message to send.level- The message level.callback- The callback to configure the scope for a single invocation.- Returns:
- The Id (SentryId object) of the event
-
captureFeedback
Deprecated.Description copied from interface:IScopesCaptures the feedback.- Specified by:
captureFeedbackin interfaceIScopes- Parameters:
feedback- The feedback to send.- Returns:
- The Id (SentryId object) of the event
-
captureFeedback
@NotNull public @NotNull SentryId captureFeedback(@NotNull @NotNull Feedback feedback, @Nullable @Nullable Hint hint) Deprecated.Description copied from interface:IScopesCaptures the feedback.- Specified by:
captureFeedbackin interfaceIScopes- Parameters:
feedback- The feedback to send.hint- An optional hint to be applied to the event.- Returns:
- The Id (SentryId object) of the event
-
captureFeedback
@NotNull public @NotNull SentryId captureFeedback(@NotNull @NotNull Feedback feedback, @Nullable @Nullable Hint hint, @Nullable @Nullable ScopeCallback callback) Deprecated.Description copied from interface:IScopesCaptures the feedback.- Specified by:
captureFeedbackin interfaceIScopes- Parameters:
feedback- The feedback to send.hint- An optional hint to be applied to the event.callback- The callback to configure the scope for a single invocation.- Returns:
- The Id (SentryId object) of the event
-
captureEnvelope
@Internal @NotNull public @NotNull SentryId captureEnvelope(@NotNull @NotNull SentryEnvelope envelope, @Nullable @Nullable Hint hint) Deprecated.Description copied from interface:IScopesCaptures an envelope.- Specified by:
captureEnvelopein interfaceIScopes- Parameters:
envelope- the SentryEnvelope to send.hint- SDK specific but provides high level information about the origin of the event- Returns:
- The Id (SentryId object) of the event
-
captureException
@NotNull public @NotNull SentryId captureException(@NotNull @NotNull Throwable throwable, @Nullable @Nullable Hint hint) Deprecated.Description copied from interface:IScopesCaptures the exception.- Specified by:
captureExceptionin interfaceIScopes- Parameters:
throwable- The exception.hint- SDK specific but provides high level information about the origin of the event- Returns:
- The Id (SentryId object) of the event
-
captureException
@NotNull public @NotNull SentryId captureException(@NotNull @NotNull Throwable throwable, @Nullable @Nullable Hint hint, @NotNull @NotNull ScopeCallback callback) Deprecated.Description copied from interface:IScopesCaptures the exception.- Specified by:
captureExceptionin interfaceIScopes- Parameters:
throwable- The exception.hint- SDK specific but provides high level information about the origin of the eventcallback- The callback to configure the scope for a single invocation.- Returns:
- The Id (SentryId object) of the event
-
captureUserFeedback
Deprecated.Description copied from interface:IScopesCaptures a manually created user feedback and sends it to Sentry.- Specified by:
captureUserFeedbackin interfaceIScopes- Parameters:
userFeedback- The user feedback to send to Sentry.
-
startSession
public void startSession()Deprecated.Description copied from interface:IScopesStarts a new session. If there's a running session, it ends it before starting the new one.- Specified by:
startSessionin interfaceIScopes
-
endSession
public void endSession()Deprecated.Description copied from interface:IScopesEnds the current session- Specified by:
endSessionin interfaceIScopes
-
close
public void close(boolean isRestarting) Deprecated.Description copied from interface:IScopesFlushes out the queue for up to timeout seconds and disable the Scopes. -
close
public void close()Deprecated.Description copied from interface:IScopesFlushes out the queue for up to timeout seconds and disable the Scopes. -
addBreadcrumb
Deprecated.Description copied from interface:IScopesAdds a breadcrumb to the current Scope- Specified by:
addBreadcrumbin interfaceIScopes- Parameters:
breadcrumb- the breadcrumbhint- SDK specific but provides high level information about the origin of the event
-
addBreadcrumb
Deprecated.Description copied from interface:IScopesAdds a breadcrumb to the current Scope- Specified by:
addBreadcrumbin interfaceIScopes- Parameters:
breadcrumb- the breadcrumb
-
setLevel
Deprecated.Description copied from interface:IScopesSets the level of all events sent within current Scope -
setTransaction
Deprecated.Description copied from interface:IScopesSets the name of the current transaction to the current Scope.- Specified by:
setTransactionin interfaceIScopes- Parameters:
transaction- the transaction
-
setUser
Deprecated.Description copied from interface:IScopesShallow merges user configuration (email, username, etc) to the current Scope. -
setFingerprint
Deprecated.Description copied from interface:IScopesSets the fingerprint to group specific events together to the current Scope.- Specified by:
setFingerprintin interfaceIScopes- Parameters:
fingerprint- the fingerprints
-
clearBreadcrumbs
public void clearBreadcrumbs()Deprecated.Description copied from interface:IScopesDeletes current breadcrumbs from the current scope.- Specified by:
clearBreadcrumbsin interfaceIScopes
-
setTag
Deprecated.Description copied from interface:IScopesSets the tag to a string value to the current Scope, overwriting a potential previous value -
removeTag
Deprecated.Description copied from interface:IScopesRemoves the tag to a string value to the current Scope -
setExtra
Deprecated.Description copied from interface:IScopesSets the extra key to an arbitrary value to the current Scope, overwriting a potential previous value -
removeExtra
Deprecated.Description copied from interface:IScopesRemoves the extra key to an arbitrary value to the current Scope- Specified by:
removeExtrain interfaceIScopes- Parameters:
key- the key
-
getLastEventId
Deprecated.Description copied from interface:IScopesLast event id recorded in the current scope- Specified by:
getLastEventIdin interfaceIScopes- Returns:
- last SentryId
-
pushScope
Deprecated.Description copied from interface:IScopesPushes a new scope while inheriting the current scope's data. -
pushIsolationScope
Deprecated.- Specified by:
pushIsolationScopein interfaceIScopes
-
popScope
Deprecated.please callISentryLifecycleToken.close()on the token returned byScopesAdapter.pushScope()orScopesAdapter.pushIsolationScope()instead.Description copied from interface:IScopesRemoves the first scope and restores its parent. -
withScope
Deprecated.Description copied from interface:IScopesRuns the callback with a new current scope which gets dropped at the end.If you're using the Sentry SDK in globalHubMode (defaults to true on Android)
Sentry.init(Sentry.OptionsConfiguration, boolean)calling withScope is discouraged, as scope changes may be dropped when executed in parallel. UseIScopes.configureScope(ScopeCallback)instead. -
withIsolationScope
Deprecated.Description copied from interface:IScopesRuns the callback with a new isolation scope which gets dropped at the end. Current scope is also forked.If you're using the Sentry SDK in globalHubMode (defaults to true on Android)
Sentry.init(Sentry.OptionsConfiguration, boolean)calling withScope is discouraged, as scope changes may be dropped when executed in parallel. UseIScopes.configureScope(ScopeType, ScopeCallback)instead.- Specified by:
withIsolationScopein interfaceIScopes- Parameters:
callback- the callback
-
configureScope
public void configureScope(@Nullable @Nullable ScopeType scopeType, @NotNull @NotNull ScopeCallback callback) Deprecated.Description copied from interface:IScopesConfigures the scope through the callback.- Specified by:
configureScopein interfaceIScopescallback- The configure scope callback.
-
bindClient
Deprecated.Description copied from interface:IScopesBinds a different client to the scopes- Specified by:
bindClientin interfaceIScopes- Parameters:
client- the client.
-
isHealthy
public boolean isHealthy()Deprecated.Description copied from interface:IScopesWhether the transport is healthy. -
flush
public void flush(long timeoutMillis) Deprecated.Description copied from interface:IScopesFlushes events queued up, but keeps the scopes enabled. -
clone
Deprecated.please useIScopes.forkedScopes(String)orIScopes.forkedCurrentScope(String)instead.Description copied from interface:IScopesClones the Hub -
forkedScopes
Deprecated.Description copied from interface:IScopesCreates a fork of both current and isolation scope from current scopes.- Specified by:
forkedScopesin interfaceIScopes- Parameters:
creator- debug information to see why scopes where forked- Returns:
- forked Scopes
-
forkedCurrentScope
Deprecated.Description copied from interface:IScopesCreates a fork of current scope without forking isolation scope.- Specified by:
forkedCurrentScopein interfaceIScopes- Parameters:
creator- debug information to see why scopes where forked- Returns:
- forked Scopes
-
forkedRootScopes
Deprecated.Description copied from interface:IScopesCreates a fork of both current and isolation scope from root scopes.- Specified by:
forkedRootScopesin interfaceIScopes- Parameters:
creator- debug information to see why scopes where forked- Returns:
- forked Scopes
-
makeCurrent
Deprecated.Description copied from interface:IScopesStores this Scopes in store, making it the current one that is used by static API.- Specified by:
makeCurrentin interfaceIScopes- Returns:
- a token you should call .close() on when you're done.
-
getScope
Deprecated.Description copied from interface:IScopesReturns the current scope of this Scopes. -
getIsolationScope
Deprecated.Description copied from interface:IScopesReturns the isolation scope of this Scopes.- Specified by:
getIsolationScopein interfaceIScopes- Returns:
- isolation scope
-
getGlobalScope
Deprecated.Description copied from interface:IScopesReturns the global scope.- Specified by:
getGlobalScopein interfaceIScopes- Returns:
- global scope
-
getParentScopes
Deprecated.Description copied from interface:IScopesReturns the parent of this Scopes instance or null, if it does not have a parent. The parent is the Scopes instance this instance was forked from.- Specified by:
getParentScopesin interfaceIScopes- Returns:
- parent Scopes or null
-
isAncestorOf
Deprecated.Description copied from interface:IScopesChecks whether this Scopes instance is direct or indirect parent of the other Scopes instance.- Specified by:
isAncestorOfin interfaceIScopes- Parameters:
otherScopes- Scopes instance that could be a direct or indirect child.- Returns:
- true if this Scopes instance is a direct or indirect parent of the other Scopes.
-
captureTransaction
@NotNull public @NotNull SentryId captureTransaction(@NotNull @NotNull SentryTransaction transaction, @Nullable @Nullable TraceContext traceContext, @Nullable @Nullable Hint hint, @Nullable @Nullable ProfilingTraceData profilingTraceData) Deprecated.Description copied from interface:IScopesCaptures the transaction and enqueues it for sending to Sentry server.- Specified by:
captureTransactionin interfaceIScopes- Parameters:
transaction- the transactiontraceContext- the trace contexthint- the hintsprofilingTraceData- the profiling trace data- Returns:
- transaction's id
-
startTransaction
@NotNull public @NotNull ITransaction startTransaction(@NotNull @NotNull TransactionContext transactionContext, @NotNull @NotNull TransactionOptions transactionOptions) Deprecated.Description copied from interface:IScopesCreates a Transaction and returns the instance. Based on the passed transaction context and transaction options the decision if transaction is sampled will be taken byTracesSampler.- Specified by:
startTransactionin interfaceIScopes- Parameters:
transactionContext- the transaction contexttransactionOptions- the transaction options- Returns:
- created transaction.
-
startProfiler
public void startProfiler()Deprecated.- Specified by:
startProfilerin interfaceIScopes
-
stopProfiler
public void stopProfiler()Deprecated.- Specified by:
stopProfilerin interfaceIScopes
-
captureProfileChunk
@NotNull public @NotNull SentryId captureProfileChunk(@NotNull @NotNull ProfileChunk profilingContinuousData) Deprecated.Description copied from interface:IScopesCaptures the profile chunk and enqueues it for sending to Sentry server.- Specified by:
captureProfileChunkin interfaceIScopes- Parameters:
profilingContinuousData- the continuous profiling payload- Returns:
- the profile chunk id
-
setSpanContext
public void setSpanContext(@NotNull @NotNull Throwable throwable, @NotNull @NotNull ISpan span, @NotNull @NotNull String transactionName) Deprecated.Description copied from interface:IScopesAssociatesISpanand the transaction name with theThrowable. Used to determine in which trace the exception has been thrown in framework integrations.- Specified by:
setSpanContextin interfaceIScopes- Parameters:
throwable- the throwablespan- the span contexttransactionName- the transaction name
-
getSpan
Deprecated.Description copied from interface:IScopesGets the current active transaction or span. -
setActiveSpan
Deprecated.- Specified by:
setActiveSpanin interfaceIScopes
-
getTransaction
Deprecated.Description copied from interface:IScopesReturns the transaction.- Specified by:
getTransactionin interfaceIScopes- Returns:
- the transaction or null when no active transaction is running.
-
getOptions
Deprecated.Description copied from interface:IScopesGets theSentryOptionsattached to current scope.- Specified by:
getOptionsin interfaceIScopes- Returns:
- the options attached to current scope.
-
isCrashedLastRun
Deprecated.Description copied from interface:IScopesReturns if the App has crashed (Process has terminated) during the last run. It only returns true or false if offline caching {SentryOptions.getCacheDirPath()} is set with a valid dir.If the call to this method is early in the App lifecycle and the SDK could not check if the App has crashed in the background, the check is gonna do IO in the calling thread.
- Specified by:
isCrashedLastRunin interfaceIScopes- Returns:
- true if App has crashed, false otherwise, and null if not evaluated yet
-
reportFullyDisplayed
public void reportFullyDisplayed()Deprecated.Description copied from interface:IScopesReport a screen has been fully loaded. That means all data needed by the UI was loaded. If time-to-full-display tracing {SentryOptions.isEnableTimeToFullDisplayTracing()} is disabled this call is ignored.This method is safe to be called multiple times. If the time-to-full-display span is already finished, this call will be ignored.
- Specified by:
reportFullyDisplayedin interfaceIScopes
-
continueTrace
@Nullable public @Nullable TransactionContext continueTrace(@Nullable @Nullable String sentryTrace, @Nullable @Nullable List<String> baggageHeaders) Deprecated.Description copied from interface:IScopesContinue a trace based on HTTP header values. If no "sentry-trace" header is provided a random trace ID and span ID is created.- Specified by:
continueTracein interfaceIScopes- Parameters:
sentryTrace- "sentry-trace" headerbaggageHeaders- "baggage" headers- Returns:
- a transaction context for starting a transaction or null if performance is disabled
-
getTraceparent
Deprecated.Description copied from interface:IScopesReturns the "sentry-trace" header that allows tracing across services. Can also be used in <meta> HTML tags. Also seeIScopes.getBaggage().- Specified by:
getTraceparentin interfaceIScopes- Returns:
- sentry trace header or null
-
getBaggage
Deprecated.Description copied from interface:IScopesReturns the "baggage" header that allows tracing across services. Can also be used in <meta> HTML tags. Also seeIScopes.getTraceparent().- Specified by:
getBaggagein interfaceIScopes- Returns:
- baggage header or null
-
captureCheckIn
Deprecated.- Specified by:
captureCheckInin interfaceIScopes
-
captureReplay
@NotNull public @NotNull SentryId captureReplay(@NotNull @NotNull SentryReplayEvent replay, @Nullable @Nullable Hint hint) Deprecated.- Specified by:
captureReplayin interfaceIScopes
-
getRateLimiter
Deprecated.- Specified by:
getRateLimiterin interfaceIScopes
-
logger
Deprecated.
-
ScopesAdapterinstead