Package io.sentry
Class Scope
java.lang.Object
io.sentry.Scope
Scope data to be sent with the event
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacethe IWithPropagationContext callbackstatic interfacethe IWithTransaction callback -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachment(@NotNull Attachment attachment) Adds an attachment to the Scope's list of attachments.voidaddBreadcrumb(@NotNull Breadcrumb breadcrumb) Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if setvoidaddBreadcrumb(@NotNull Breadcrumb breadcrumb, @Nullable Hint hint) Adds a breadcrumb to the breadcrumbs queue It also executes the BeforeBreadcrumb callback if setvoidaddEventProcessor(@NotNull EventProcessor eventProcessor) Adds an event processor to the Scope's event processors listvoidclear()Resets the Scope to its default statevoidClear all attachments.voidClear all the breadcrumbsvoidClears the transaction.@NotNull Queue<Breadcrumb>Returns the Scope's breadcrumbs queue@NotNull ContextsReturns the Scope's contextsReturns the Scope's extra mapReturns the Scope's fingerprint list@Nullable SentryLevelgetLevel()Returns the Scope's SentryLevel@NotNull PropagationContext@Nullable RequestReturns the Scope's request@Nullable Session@Nullable ISpangetSpan()Returns current active Span or Transaction.getTags()Returns the Scope's tags@Nullable ITransactionReturns active transaction or null if there is no active transaction.@Nullable StringReturns the Scope's transaction name.@Nullable UsergetUser()Returns the Scope's uservoidremoveContexts(@NotNull String key) Removes a value from the Scope's contextsvoidremoveExtra(@NotNull String key) Removes an extra from the Scope's extrasvoidRemoves a tag from the Scope's tagsvoidsetContexts(@NotNull String key, @NotNull Boolean value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Character value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Number value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Object value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Object[] value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull String value) Sets the Scope's contextsvoidsetContexts(@NotNull String key, @NotNull Collection<?> value) Sets the Scope's contextsvoidSets an extra to the Scope's extra mapvoidsetFingerprint(@NotNull List<String> fingerprint) Sets the Scope's fingerprint listvoidsetLevel(@Nullable SentryLevel level) Sets the Scope's SentryLevel Level from scope exceptionally take precedence over the eventvoidsetPropagationContext(@NotNull PropagationContext propagationContext) voidsetRequest(@Nullable Request request) Sets the Scope's requestvoidSets a tag to Scope's tagsvoidsetTransaction(@NotNull String transaction) Sets the Scope's transaction.voidsetTransaction(@Nullable ITransaction transaction) Sets the current active transactionvoidSets the Scope's user@NotNull PropagationContextwithPropagationContext(@NotNull Scope.IWithPropagationContext callback) voidwithTransaction(@NotNull Scope.IWithTransaction callback) Mutates the current transaction atomically
-
Constructor Details
-
Scope
Scope's ctor- Parameters:
options- the options
-
Scope
-
-
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
-
getFingerprint
Returns the Scope's fingerprint list- Returns:
- the fingerprint list
-
setFingerprint
Sets the Scope's fingerprint list- Parameters:
fingerprint- the fingerprint list
-
getBreadcrumbs
Returns the Scope's breadcrumbs queue- Returns:
- the breadcrumbs queue
-
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
-
getExtras
Returns the Scope's extra map- Returns:
- the extra map
-
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
-
setPropagationContext
@Internal public void setPropagationContext(@NotNull @NotNull PropagationContext propagationContext) -
getPropagationContext
-
withPropagationContext
@Internal @NotNull public @NotNull PropagationContext withPropagationContext(@NotNull @NotNull Scope.IWithPropagationContext callback)
-