| Constructor and Description |
|---|
Hub(@NotNull SentryOptions options) |
| Modifier and Type | Method and Description |
|---|---|
void |
addBreadcrumb(@NotNull Breadcrumb breadcrumb,
@Nullable java.lang.Object hint)
Adds a breadcrumb to the current Scope
|
void |
bindClient(@NotNull ISentryClient client)
Binds a different client to the hub
|
@NotNull SentryId |
captureEnvelope(@NotNull SentryEnvelope envelope,
@Nullable java.lang.Object hint)
Captures an envelope.
|
@NotNull SentryId |
captureEvent(@NotNull SentryEvent event,
@Nullable java.lang.Object hint)
Captures the event.
|
@NotNull SentryId |
captureException(@NotNull java.lang.Throwable throwable,
@Nullable java.lang.Object hint)
Captures the exception.
|
@NotNull SentryId |
captureMessage(@NotNull java.lang.String message,
@NotNull SentryLevel level)
Captures the message.
|
@NotNull SentryId |
captureTransaction(@NotNull SentryTransaction transaction,
@Nullable java.lang.Object hint)
Captures the transaction and enqueues it for sending to Sentry server.
|
void |
captureUserFeedback(@NotNull UserFeedback userFeedback)
Captures a manually created user feedback and sends it to Sentry.
|
void |
clearBreadcrumbs()
Deletes current breadcrumbs from the current scope.
|
@NotNull IHub |
clone()
Clones the Hub
|
void |
close()
Flushes out the queue for up to timeout seconds and disable the Hub.
|
void |
configureScope(@NotNull ScopeCallback callback)
Configures the scope through the callback.
|
void |
endSession()
Ends the current session
|
void |
flush(long timeoutMillis)
Flushes events queued up, but keeps the Hub enabled.
|
@NotNull SentryId |
getLastEventId()
Last event id recorded in the current scope
|
@NotNull SentryOptions |
getOptions()
Gets the
SentryOptions attached to current scope. |
@Nullable ISpan |
getSpan()
Gets the current active transaction or span.
|
boolean |
isEnabled()
Check if the Hub is enabled/active.
|
void |
popScope()
Removes the first scope
|
void |
pushScope()
Pushes a new scope while inheriting the current scope's data.
|
void |
removeExtra(@NotNull java.lang.String key)
Removes the extra key to an arbitrary value to the current Scope
|
void |
removeTag(@NotNull java.lang.String key)
Removes the tag to a string value to the current Scope
|
void |
setExtra(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets the extra key to an arbitrary value to the current Scope, overwriting a potential previous
value
|
void |
setFingerprint(@NotNull java.util.List<java.lang.String> fingerprint)
Sets the fingerprint to group specific events together to the current Scope.
|
void |
setLevel(@Nullable SentryLevel level)
Sets the level of all events sent within current Scope
|
void |
setSpanContext(@NotNull java.lang.Throwable throwable,
@NotNull ISpan span,
@NotNull java.lang.String transactionName)
Associates
ISpan and the transaction name with the Throwable. |
void |
setTag(@NotNull java.lang.String key,
@NotNull java.lang.String value)
Sets the tag to a string value to the current Scope, overwriting a potential previous value
|
void |
setTransaction(@Nullable java.lang.String transaction)
Sets the name of the current transaction to the current Scope.
|
void |
setUser(@Nullable User user)
Shallow merges user configuration (email, username, etc) to the current Scope.
|
void |
startSession()
Starts a new session.
|
@NotNull ITransaction |
startTransaction(@NotNull TransactionContext transactionContext,
@Nullable CustomSamplingContext customSamplingContext,
boolean bindToScope)
Creates a Transaction and returns the instance.
|
@NotNull ITransaction |
startTransaction(@NotNull TransactionContext transactionContext,
@Nullable CustomSamplingContext customSamplingContext,
boolean bindToScope,
@Nullable java.util.Date startTimestamp) |
@Nullable SentryTraceHeader |
traceHeaders()
Returns trace header of active transaction or
null if no transaction is active. |
void |
withScope(@NotNull ScopeCallback callback)
Runs the callback with a new scope which gets dropped at the end
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddBreadcrumb, addBreadcrumb, addBreadcrumb, captureEnvelope, captureEvent, captureException, captureMessage, captureTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransaction, startTransactionpublic Hub(@NotNull
@NotNull SentryOptions options)
public boolean isEnabled()
IHub@NotNull public @NotNull SentryId captureEvent(@NotNull @NotNull SentryEvent event, @Nullable @Nullable java.lang.Object hint)
IHubcaptureEvent in interface IHubevent - the eventhint - SDK specific but provides high level information about the origin of the event@NotNull public @NotNull SentryId captureMessage(@NotNull @NotNull java.lang.String message, @NotNull @NotNull SentryLevel level)
IHubcaptureMessage in interface IHubmessage - The message to send.level - The message level.@ApiStatus.Internal @NotNull public @NotNull SentryId captureEnvelope(@NotNull @NotNull SentryEnvelope envelope, @Nullable @Nullable java.lang.Object hint)
IHubcaptureEnvelope in interface IHubenvelope - the SentryEnvelope to send.hint - SDK specific but provides high level information about the origin of the event@NotNull public @NotNull SentryId captureException(@NotNull @NotNull java.lang.Throwable throwable, @Nullable @Nullable java.lang.Object hint)
IHubcaptureException in interface IHubthrowable - The exception.hint - SDK specific but provides high level information about the origin of the eventpublic void captureUserFeedback(@NotNull
@NotNull UserFeedback userFeedback)
IHubcaptureUserFeedback in interface IHubuserFeedback - The user feedback to send to Sentry.public void startSession()
IHubstartSession in interface IHubpublic void endSession()
IHubendSession in interface IHubpublic void close()
IHubpublic void addBreadcrumb(@NotNull
@NotNull Breadcrumb breadcrumb,
@Nullable
@Nullable java.lang.Object hint)
IHubaddBreadcrumb in interface IHubbreadcrumb - the breadcrumbhint - SDK specific but provides high level information about the origin of the eventpublic void setLevel(@Nullable
@Nullable SentryLevel level)
IHubpublic void setTransaction(@Nullable
@Nullable java.lang.String transaction)
IHubsetTransaction in interface IHubtransaction - the transactionpublic void setUser(@Nullable
@Nullable User user)
IHubpublic void setFingerprint(@NotNull
@NotNull java.util.List<java.lang.String> fingerprint)
IHubsetFingerprint in interface IHubfingerprint - the fingerprintspublic void clearBreadcrumbs()
IHubclearBreadcrumbs in interface IHubpublic void setTag(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
IHubpublic void removeTag(@NotNull
@NotNull java.lang.String key)
IHubpublic void setExtra(@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
IHubpublic void removeExtra(@NotNull
@NotNull java.lang.String key)
IHubremoveExtra in interface IHubkey - the key@NotNull public @NotNull SentryId getLastEventId()
IHubgetLastEventId in interface IHubpublic void pushScope()
IHub@NotNull public @NotNull SentryOptions getOptions()
IHubSentryOptions attached to current scope.getOptions in interface IHubpublic void popScope()
IHubpublic void withScope(@NotNull
@NotNull ScopeCallback callback)
IHubpublic void configureScope(@NotNull
@NotNull ScopeCallback callback)
IHubconfigureScope in interface IHubcallback - The configure scope callback.public void bindClient(@NotNull
@NotNull ISentryClient client)
IHubbindClient in interface IHubclient - the client.public void flush(long timeoutMillis)
IHub@ApiStatus.Internal @NotNull public @NotNull SentryId captureTransaction(@NotNull @NotNull SentryTransaction transaction, @Nullable @Nullable java.lang.Object hint)
IHubcaptureTransaction in interface IHubtransaction - the transactionhint - the hint@NotNull public @NotNull ITransaction startTransaction(@NotNull @NotNull TransactionContext transactionContext, @Nullable @Nullable CustomSamplingContext customSamplingContext, boolean bindToScope)
IHubTracesSampler.startTransaction in interface IHubtransactionContext - the transaction contextcustomSamplingContext - the sampling contextbindToScope - if transaction should be bound to scope@ApiStatus.Internal @NotNull public @NotNull ITransaction startTransaction(@NotNull @NotNull TransactionContext transactionContext, @Nullable @Nullable CustomSamplingContext customSamplingContext, boolean bindToScope, @Nullable @Nullable java.util.Date startTimestamp)
startTransaction in interface IHub@Nullable public @Nullable SentryTraceHeader traceHeaders()
IHubnull if no transaction is active.traceHeaders in interface IHub@Nullable public @Nullable ISpan getSpan()
IHub@ApiStatus.Internal
public void setSpanContext(@NotNull
@NotNull java.lang.Throwable throwable,
@NotNull
@NotNull ISpan span,
@NotNull
@NotNull java.lang.String transactionName)
IHubISpan and the transaction name with the Throwable. Used to determine
in which trace the exception has been thrown in framework integrations.setSpanContext in interface IHubthrowable - the throwablespan - the span contexttransactionName - the transaction name