Package io.sentry
Class Breadcrumb
java.lang.Object
io.sentry.Breadcrumb
- All Implemented Interfaces:
JsonSerializable
,JsonUnknown
Series of application events
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
-
Constructor Summary
ConstructorDescriptionBreadcrumb ctorBreadcrumb
(long timestamp) Breadcrumb
(@NotNull Date timestamp) Breadcrumb ctorBreadcrumb
(@Nullable String message) Breadcrumb ctor -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Breadcrumb
Creates debug breadcrumb - typically a log message.boolean
static @NotNull Breadcrumb
Creates error breadcrumb.static Breadcrumb
fromMap
(@NotNull Map<String, Object> map, @NotNull SentryOptions options) Creates breadcrumb from a map.@Nullable String
Returns the categorygetData()
Returns the data map@Nullable Object
Returns the value of data[key] or null@Nullable SentryLevel
getLevel()
Returns the SentryLevel@Nullable String
Returns the message@Nullable String
Returns the origin@NotNull Date
Returns the Breadcrumb's timestamp as java.util.Date@Nullable String
getType()
Returns the typestatic @NotNull Breadcrumb
graphqlDataFetcher
(@Nullable String path, @Nullable String field, @Nullable String type, @Nullable String objectType) Creates a breadcrumb for a GraphQL data fetcher.static @NotNull Breadcrumb
graphqlDataLoader
(@NotNull Iterable<?> keys, @Nullable Class<?> keyType, @Nullable Class<?> valueType, @Nullable String name) Creates a breadcrumb for a GraphQL data loader.static @NotNull Breadcrumb
graphqlOperation
(@Nullable String operationName, @Nullable String operationType, @Nullable String operationId) Creates a breadcrumb for a GraphQL operation.int
hashCode()
static @NotNull Breadcrumb
Creates HTTP breadcrumb.static @NotNull Breadcrumb
Creates HTTP breadcrumb.static @NotNull Breadcrumb
Creates info breadcrumb - information that helps identify the root cause of the issue or for whom the error occurred.static @NotNull Breadcrumb
navigation
(@NotNull String from, @NotNull String to) Creates navigation breadcrumb - a navigation event can be a URL change in a web application, or a UI transition in a mobile or desktop application, etc.static @NotNull Breadcrumb
Creates query breadcrumb - representing a query that was made in your application.void
removeData
(@NotNull String key) Removes an entry from the data's mapvoid
serialize
(@NotNull ObjectWriter writer, @NotNull ILogger logger) void
setCategory
(@Nullable String category) Sets the categoryvoid
Sets an entry to the data's mapvoid
setLevel
(@Nullable SentryLevel level) Sets the levelvoid
setMessage
(@Nullable String message) Sets the messagevoid
Sets the originvoid
Sets the typevoid
setUnknown
(@Nullable Map<String, Object> unknown) static @NotNull Breadcrumb
transaction
(@NotNull String message) Creates transaction breadcrumb - describing a tracing event.static @NotNull Breadcrumb
Creates ui breadcrumb - a user interaction with your app's UI.static @NotNull Breadcrumb
Creates user breadcrumb - a user interaction with your app's UI.static @NotNull Breadcrumb
userInteraction
(@NotNull String subCategory, @Nullable String viewId, @Nullable String viewClass) Creates user breadcrumb - a user interaction with your app's UI.static @NotNull Breadcrumb
userInteraction
(@NotNull String subCategory, @Nullable String viewId, @Nullable String viewClass, @NotNull Map<String, Object> additionalData) Creates user breadcrumb - a user interaction with your app's UI.static @NotNull Breadcrumb
userInteraction
(@NotNull String subCategory, @Nullable String viewId, @Nullable String viewClass, @Nullable String viewTag, @NotNull Map<String, Object> additionalData) Creates user breadcrumb - a user interaction with your app's UI.
-
Constructor Details
-
Breadcrumb
Breadcrumb ctor- Parameters:
timestamp
- the timestamp
-
Breadcrumb
public Breadcrumb(long timestamp) -
Breadcrumb
public Breadcrumb()Breadcrumb ctor -
Breadcrumb
Breadcrumb ctor- Parameters:
message
- the message
-
-
Method Details
-
fromMap
public static Breadcrumb fromMap(@NotNull @NotNull Map<String, Object> map, @NotNull @NotNull SentryOptions options) Creates breadcrumb from a map.- Parameters:
map
- - The breadcrumb data as mapoptions
- - the sentry options- Returns:
- the breadcrumb
-
http
@NotNull public static @NotNull Breadcrumb http(@NotNull @NotNull String url, @NotNull @NotNull String method) Creates HTTP breadcrumb.- Parameters:
url
- - the request URLmethod
- - the request method- Returns:
- the breadcrumb
-
http
@NotNull public static @NotNull Breadcrumb http(@NotNull @NotNull String url, @NotNull @NotNull String method, @Nullable @Nullable Integer code) Creates HTTP breadcrumb.- Parameters:
url
- - the request URLmethod
- - the request methodcode
- - the code result. Code can be null when http request did not finish or ended with network error- Returns:
- the breadcrumb
-
graphqlOperation
@NotNull public static @NotNull Breadcrumb graphqlOperation(@Nullable @Nullable String operationName, @Nullable @Nullable String operationType, @Nullable @Nullable String operationId) Creates a breadcrumb for a GraphQL operation.- Parameters:
operationName
- - the name of the GraphQL operationoperationType
- - the type of GraphQL operation (e.g. query, mutation, subscription)operationId
- - the ID of the GraphQL operation- Returns:
- the breadcrumb
-
graphqlDataFetcher
@NotNull public static @NotNull Breadcrumb graphqlDataFetcher(@Nullable @Nullable String path, @Nullable @Nullable String field, @Nullable @Nullable String type, @Nullable @Nullable String objectType) Creates a breadcrumb for a GraphQL data fetcher.- Parameters:
path
- - the name of the GraphQL operationfield
- - the field being fetchedtype
- - the type being fetchedobjectType
- - the object type of the GraphQL data fetch operation- Returns:
- the breadcrumb
-
graphqlDataLoader
@NotNull public static @NotNull Breadcrumb graphqlDataLoader(@NotNull @NotNull Iterable<?> keys, @Nullable @Nullable Class<?> keyType, @Nullable @Nullable Class<?> valueType, @Nullable @Nullable String name) Creates a breadcrumb for a GraphQL data loader.- Parameters:
keys
- - keys to be fetched by the data loaderkeyType
- - class of the data loaders key(s)valueType
- - class of the data loaders value(s)name
- - name of the data loader- Returns:
- the breadcrumb
-
transaction
Creates transaction breadcrumb - describing a tracing event.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
debug
Creates debug breadcrumb - typically a log message. The data part is entirely undefined and as such, completely rendered as a key/value table.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
error
Creates error breadcrumb.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
info
Creates info breadcrumb - information that helps identify the root cause of the issue or for whom the error occurred.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
query
Creates query breadcrumb - representing a query that was made in your application.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
ui
@NotNull public static @NotNull Breadcrumb ui(@NotNull @NotNull String category, @NotNull @NotNull String message) Creates ui breadcrumb - a user interaction with your app's UI.- Parameters:
category
- - the category, for example "click"message
- - the message- Returns:
- the breadcrumb
-
user
@NotNull public static @NotNull Breadcrumb user(@NotNull @NotNull String category, @NotNull @NotNull String message) Creates user breadcrumb - a user interaction with your app's UI.- Parameters:
message
- - the message- Returns:
- the breadcrumb
-
userInteraction
@NotNull public static @NotNull Breadcrumb userInteraction(@NotNull @NotNull String subCategory, @Nullable @Nullable String viewId, @Nullable @Nullable String viewClass) Creates user breadcrumb - a user interaction with your app's UI. The breadcrumb can contain additional data likeviewId
orviewClass
. By default, the breadcrumb is captured withSentryLevel
INFO level.- Parameters:
subCategory
- - the category, for example "click"viewId
- - the human-readable view id, for example "button_load"viewClass
- - the fully qualified class name, for example "android.widget.Button"- Returns:
- the breadcrumb
-
userInteraction
@NotNull public static @NotNull Breadcrumb userInteraction(@NotNull @NotNull String subCategory, @Nullable @Nullable String viewId, @Nullable @Nullable String viewClass, @Nullable @Nullable String viewTag, @NotNull @NotNull Map<String, Object> additionalData) Creates user breadcrumb - a user interaction with your app's UI. The breadcrumb can contain additional data likeviewId
orviewClass
. By default, the breadcrumb is captured withSentryLevel
INFO level.- Parameters:
subCategory
- - the category, for example "click"viewId
- - the human-readable view id, for example "button_load"viewClass
- - the fully qualified class name, for example "android.widget.Button"viewTag
- - the custom tag of the view, for example "button_launch_rocket"additionalData
- - additional properties to be put into the data bag- Returns:
- the breadcrumb
-
userInteraction
@NotNull public static @NotNull Breadcrumb userInteraction(@NotNull @NotNull String subCategory, @Nullable @Nullable String viewId, @Nullable @Nullable String viewClass, @NotNull @NotNull Map<String, Object> additionalData) Creates user breadcrumb - a user interaction with your app's UI. The breadcrumb can contain additional data likeviewId
orviewClass
. By default, the breadcrumb is captured withSentryLevel
INFO level.- Parameters:
subCategory
- - the category, for example "click"viewId
- - the human-readable view id, for example "button_load"viewClass
- - the fully qualified class name, for example "android.widget.Button"additionalData
- - additional properties to be put into the data bag- Returns:
- the breadcrumb
-
getTimestamp
Returns the Breadcrumb's timestamp as java.util.Date- Returns:
- the timestamp
-
getMessage
Returns the message- Returns:
- the message
-
setMessage
Sets the message- Parameters:
message
- the message
-
getType
Returns the type- Returns:
- the type
-
setType
Sets the type- Parameters:
type
- the type
-
getData
Returns the data map- Returns:
- the data map
-
getData
Returns the value of data[key] or null- Parameters:
key
- the key- Returns:
- the value or null
-
setData
Sets an entry to the data's map- Parameters:
key
- the keyvalue
- the value
-
removeData
Removes an entry from the data's map- Parameters:
key
- the key
-
getCategory
Returns the category- Returns:
- the category
-
setCategory
Sets the category- Parameters:
category
- the category
-
getOrigin
Returns the origin- Returns:
- the origin
-
setOrigin
Sets the origin- Parameters:
origin
- the origin
-
getLevel
Returns the SentryLevel- Returns:
- the level
-
setLevel
Sets the level- Parameters:
level
- the level
-
equals
-
hashCode
public int hashCode() -
getUnknown
- Specified by:
getUnknown
in interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknown
in interfaceJsonUnknown
-
serialize
public void serialize(@NotNull @NotNull ObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serialize
in interfaceJsonSerializable
- Throws:
IOException
-