Modifier and Type | Method and Description |
---|---|
void |
addBreadcrumb(Breadcrumb breadcrumb,
@Nullable java.lang.Object hint)
Adds a breadcrumb to the current Scope
|
void |
bindClient(ISentryClient client)
Binds a different client to the hub
|
SentryId |
captureEnvelope(SentryEnvelope envelope,
@Nullable java.lang.Object hint)
Captures an envelope.
|
SentryId |
captureEvent(SentryEvent event,
@Nullable java.lang.Object hint)
Captures the event.
|
SentryId |
captureException(java.lang.Throwable throwable,
@Nullable java.lang.Object hint)
Captures the exception.
|
SentryId |
captureMessage(java.lang.String message,
SentryLevel level)
Captures the message.
|
@NotNull SentryId |
captureTransaction(ITransaction transaction,
java.lang.Object hint)
Captures the transaction and enqueues it for sending to Sentry server.
|
void |
captureUserFeedback(UserFeedback userFeedback)
Captures a manually created user feedback and sends it to Sentry.
|
void |
clearBreadcrumbs()
Deletes current breadcrumbs from the current scope.
|
IHub |
clone()
Clones the Hub
|
void |
close()
Flushes out the queue for up to timeout seconds and disable the Hub.
|
void |
configureScope(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.
|
static HubAdapter |
getInstance() |
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(java.lang.String key)
Removes the extra key to an arbitrary value to the current Scope
|
void |
removeTag(java.lang.String key)
Removes the tag to a string value to the current Scope
|
void |
setExtra(java.lang.String key,
java.lang.String value)
Sets the extra key to an arbitrary value to the current Scope, overwriting a potential previous
value
|
void |
setFingerprint(java.util.List<java.lang.String> fingerprint)
Sets the fingerprint to group specific events together to the current Scope.
|
void |
setLevel(SentryLevel level)
Sets the level of all events sent within current Scope
|
void |
setSpanContext(@NotNull java.lang.Throwable t,
@NotNull ISpan sc)
Associates
ISpan with the Throwable . |
void |
setTag(java.lang.String key,
java.lang.String value)
Sets the tag to a string value to the current Scope, overwriting a potential previous value
|
void |
setTransaction(java.lang.String transaction)
Sets the name of the current transaction to the current Scope.
|
void |
setUser(User user)
Shallow merges user configuration (email, username, etc) to the current Scope.
|
void |
startSession()
Starts a new session.
|
@NotNull ITransaction |
startTransaction(java.lang.String name,
java.lang.String operation,
CustomSamplingContext customSamplingContext)
Creates a Transaction bound to the current hub and returns the instance.
|
@NotNull ITransaction |
startTransaction(TransactionContext transactionContexts)
Creates a Transaction bound to the current hub and returns the instance.
|
@NotNull ITransaction |
startTransaction(TransactionContext transactionContexts,
CustomSamplingContext customSamplingContext)
Creates a Transaction bound to the current hub and returns the instance.
|
@Nullable SentryTraceHeader |
traceHeaders()
Returns trace header of active transaction or
null if no transaction is active. |
void |
withScope(ScopeCallback callback)
Runs the callback with a new scope which gets dropped at the end
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBreadcrumb, addBreadcrumb, addBreadcrumb, captureEnvelope, captureEvent, captureException, captureMessage, captureTransaction, startTransaction
public static HubAdapter getInstance()
public boolean isEnabled()
IHub
public SentryId captureEvent(SentryEvent event, @Nullable @Nullable java.lang.Object hint)
IHub
captureEvent
in interface IHub
event
- the eventhint
- SDK specific but provides high level information about the origin of the eventpublic SentryId captureMessage(java.lang.String message, SentryLevel level)
IHub
captureMessage
in interface IHub
message
- The message to send.level
- The message level.@ApiStatus.Internal public SentryId captureEnvelope(SentryEnvelope envelope, @Nullable @Nullable java.lang.Object hint)
IHub
captureEnvelope
in interface IHub
envelope
- the SentryEnvelope to send.hint
- SDK specific but provides high level information about the origin of the eventpublic SentryId captureException(java.lang.Throwable throwable, @Nullable @Nullable java.lang.Object hint)
IHub
captureException
in interface IHub
throwable
- The exception.hint
- SDK specific but provides high level information about the origin of the eventpublic void captureUserFeedback(UserFeedback userFeedback)
IHub
captureUserFeedback
in interface IHub
userFeedback
- The user feedback to send to Sentry.public void startSession()
IHub
startSession
in interface IHub
public void endSession()
IHub
endSession
in interface IHub
public void close()
IHub
public void addBreadcrumb(Breadcrumb breadcrumb, @Nullable @Nullable java.lang.Object hint)
IHub
addBreadcrumb
in interface IHub
breadcrumb
- the breadcrumbhint
- SDK specific but provides high level information about the origin of the eventpublic void setLevel(SentryLevel level)
IHub
public void setTransaction(java.lang.String transaction)
IHub
setTransaction
in interface IHub
transaction
- the transactionpublic void setUser(User user)
IHub
public void setFingerprint(java.util.List<java.lang.String> fingerprint)
IHub
setFingerprint
in interface IHub
fingerprint
- the fingerprintspublic void clearBreadcrumbs()
IHub
clearBreadcrumbs
in interface IHub
public void setTag(java.lang.String key, java.lang.String value)
IHub
public void removeTag(java.lang.String key)
IHub
public void setExtra(java.lang.String key, java.lang.String value)
IHub
public void removeExtra(java.lang.String key)
IHub
removeExtra
in interface IHub
key
- the keypublic SentryId getLastEventId()
IHub
getLastEventId
in interface IHub
public void pushScope()
IHub
public void popScope()
IHub
public void withScope(ScopeCallback callback)
IHub
public void configureScope(ScopeCallback callback)
IHub
configureScope
in interface IHub
callback
- The configure scope callback.public void bindClient(ISentryClient client)
IHub
bindClient
in interface IHub
client
- the client.public void flush(long timeoutMillis)
IHub
@NotNull public @NotNull SentryId captureTransaction(ITransaction transaction, java.lang.Object hint)
IHub
captureTransaction
in interface IHub
transaction
- the transactionhint
- the hint@NotNull public @NotNull ITransaction startTransaction(TransactionContext transactionContexts)
IHub
startTransaction
in interface IHub
transactionContexts
- the transaction contexts@NotNull public @NotNull ITransaction startTransaction(TransactionContext transactionContexts, CustomSamplingContext customSamplingContext)
IHub
TracesSampler
.startTransaction
in interface IHub
transactionContexts
- the transaction contextcustomSamplingContext
- the sampling context@NotNull public @NotNull ITransaction startTransaction(java.lang.String name, java.lang.String operation, CustomSamplingContext customSamplingContext)
IHub
TracesSampler
.startTransaction
in interface IHub
name
- the transaction nameoperation
- the operationcustomSamplingContext
- the sampling context@Nullable public @Nullable SentryTraceHeader traceHeaders()
IHub
null
if no transaction is active.traceHeaders
in interface IHub
public void setSpanContext(@NotNull @NotNull java.lang.Throwable t, @NotNull @NotNull ISpan sc)
IHub
ISpan
with the Throwable
. Used to determine in which trace the
exception has been thrown in framework integrations.setSpanContext
in interface IHub
t
- the throwablesc
- the span context@Nullable public @Nullable ISpan getSpan()
IHub
@NotNull public @NotNull SentryOptions getOptions()
IHub
SentryOptions
attached to current scope.getOptions
in interface IHub