Package io.sentry
Class Scope
java.lang.Object
io.sentry.Scope
Scope data to be sent with the event
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
the IWithTransaction callback -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttachment
(@NotNull Attachment attachment) Adds an attachment to the Scope's list of attachments.void
addBreadcrumb
(@NotNull Breadcrumb breadcrumb) Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if setvoid
addBreadcrumb
(@NotNull Breadcrumb breadcrumb, @Nullable Hint hint) Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if setvoid
addEventProcessor
(@NotNull EventProcessor eventProcessor) Adds an event processor to the Scope's event processors listvoid
clear()
Resets the Scope to its default statevoid
Clear all attachments.void
Clear all the breadcrumbsvoid
Clears the transaction.@NotNull Contexts
Returns the Scope's contexts@Nullable SentryLevel
getLevel()
Returns the Scope's SentryLevel@Nullable Request
Returns the Scope's request@Nullable Session
@Nullable ISpan
getSpan()
Returns current active Span or Transaction.getTags()
Returns the Scope's tags@Nullable ITransaction
Returns active transaction or null if there is no active transaction.@Nullable String
Returns the Scope's transaction name.@Nullable User
getUser()
Returns the Scope's uservoid
removeContexts
(@NotNull String key) Removes a value from the Scope's contextsvoid
removeExtra
(@NotNull String key) Removes an extra from the Scope's extrasvoid
Removes a tag from the Scope's tagsvoid
setContexts
(@NotNull String key, @NotNull Boolean value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Character value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Number value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Object value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Object[] value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull String value) Sets the Scope's contextsvoid
setContexts
(@NotNull String key, @NotNull Collection<?> value) Sets the Scope's contextsvoid
Sets an extra to the Scope's extra mapvoid
setFingerprint
(@NotNull List<String> fingerprint) Sets the Scope's fingerprint listvoid
setLevel
(@Nullable SentryLevel level) Sets the Scope's SentryLevel Level from scope exceptionally take precedence over the eventvoid
setRequest
(@Nullable Request request) Sets the Scope's requestvoid
Sets a tag to Scope's tagsvoid
setTransaction
(@NotNull String transaction) Sets the Scope's transaction.void
setTransaction
(@Nullable ITransaction transaction) Sets the current active transactionvoid
Sets the Scope's uservoid
withTransaction
(@NotNull Scope.IWithTransaction callback) Mutates the current transaction atomically
-
Constructor Details
-
Scope
Scope's ctor- Parameters:
options
- the options
-
-
Method Details
-
getLevel
Returns the Scope's SentryLevel- Returns:
- the SentryLevel
-
setLevel
Sets the Scope's SentryLevel Level from scope exceptionally take precedence over the event- Parameters:
level
- the SentryLevel
-
getTransactionName
Returns the Scope's transaction name.- Returns:
- the transaction
-
setTransaction
Sets the Scope's transaction.- Parameters:
transaction
- the transaction
-
getSpan
Returns current active Span or Transaction.- Returns:
- current active Span or Transaction or null if transaction has not been set.
-
setTransaction
Sets the current active transaction- Parameters:
transaction
- the transaction
-
getUser
Returns the Scope's user- Returns:
- the user
-
setUser
Sets the Scope's user- Parameters:
user
- the user
-
getRequest
Returns the Scope's request- Returns:
- the request
-
setRequest
Sets the Scope's request- Parameters:
request
- the request
-
setFingerprint
Sets the Scope's fingerprint list- Parameters:
fingerprint
- the fingerprint list
-
addBreadcrumb
Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if set- Parameters:
breadcrumb
- the breadcrumbhint
- the hint
-
addBreadcrumb
Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if set- Parameters:
breadcrumb
- the breadcrumb
-
clearBreadcrumbs
public void clearBreadcrumbs()Clear all the breadcrumbs -
clearTransaction
public void clearTransaction()Clears the transaction. -
getTransaction
Returns active transaction or null if there is no active transaction.- Returns:
- the transaction
-
clear
public void clear()Resets the Scope to its default state -
getTags
Returns the Scope's tags- Returns:
- the tags map
-
setTag
Sets a tag to Scope's tags- Parameters:
key
- the keyvalue
- the value
-
removeTag
Removes a tag from the Scope's tags- Parameters:
key
- the key
-
setExtra
Sets an extra to the Scope's extra map- Parameters:
key
- the keyvalue
- the value
-
removeExtra
Removes an extra from the Scope's extras- Parameters:
key
- the key
-
getContexts
Returns the Scope's contexts- Returns:
- the contexts
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
setContexts
Sets the Scope's contexts- Parameters:
key
- the context keyvalue
- the context value
-
removeContexts
Removes a value from the Scope's contexts- Parameters:
key
- the Key
-
addAttachment
Adds an attachment to the Scope's list of attachments. The SDK adds the attachment to every event and transaction sent to Sentry.- Parameters:
attachment
- The attachment to add to the Scope's list of attachments.
-
clearAttachments
public void clearAttachments()Clear all attachments. -
addEventProcessor
Adds an event processor to the Scope's event processors list- Parameters:
eventProcessor
- the event processor
-
withTransaction
Mutates the current transaction atomically- Parameters:
callback
- the IWithTransaction callback
-
getSession
-