Package io.sentry
Class Breadcrumb
java.lang.Object
io.sentry.Breadcrumb
- All Implemented Interfaces:
JsonSerializable,JsonUnknown,Comparable<Breadcrumb>
public final class Breadcrumb
extends Object
implements JsonUnknown, JsonSerializable, Comparable<Breadcrumb>
Series of application events
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionBreadcrumb ctorBreadcrumb(long timestamp) Breadcrumb(@NotNull Date timestamp) Breadcrumb ctorBreadcrumb(@Nullable String message) Breadcrumb ctor -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull Breadcrumb o) static @NotNull BreadcrumbCreates debug breadcrumb - typically a log message.booleanstatic @NotNull BreadcrumbCreates error breadcrumb.static BreadcrumbfromMap(@NotNull Map<String, Object> map, @NotNull SentryOptions options) Creates breadcrumb from a map.@Nullable StringReturns the categorygetData()Returns the data map@Nullable ObjectReturns the value of data[key] or null@Nullable SentryLevelgetLevel()Returns the SentryLevel@Nullable StringReturns the message@Nullable StringReturns the origin@NotNull DateReturns the Breadcrumb's timestamp as java.util.Date@Nullable StringgetType()Returns the typestatic @NotNull BreadcrumbgraphqlDataFetcher(@Nullable String path, @Nullable String field, @Nullable String type, @Nullable String objectType) Creates a breadcrumb for a GraphQL data fetcher.static @NotNull BreadcrumbgraphqlDataLoader(@NotNull Iterable<?> keys, @Nullable Class<?> keyType, @Nullable Class<?> valueType, @Nullable String name) Creates a breadcrumb for a GraphQL data loader.static @NotNull BreadcrumbgraphqlOperation(@Nullable String operationName, @Nullable String operationType, @Nullable String operationId) Creates a breadcrumb for a GraphQL operation.inthashCode()static @NotNull BreadcrumbCreates HTTP breadcrumb.static @NotNull BreadcrumbCreates HTTP breadcrumb.static @NotNull BreadcrumbCreates info breadcrumb - information that helps identify the root cause of the issue or for whom the error occurred.static @NotNull Breadcrumbnavigation(@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 BreadcrumbCreates query breadcrumb - representing a query that was made in your application.voidremoveData(@Nullable String key) Removes an entry from the data's mapvoidserialize(@NotNull ObjectWriter writer, @NotNull ILogger logger) voidsetCategory(@Nullable String category) Sets the categoryvoidSets an entry to the data's mapvoidsetLevel(@Nullable SentryLevel level) Sets the levelvoidsetMessage(@Nullable String message) Sets the messagevoidSets the originvoidSets the typevoidsetUnknown(@Nullable Map<String, Object> unknown) static @NotNull Breadcrumbtransaction(@NotNull String message) Creates transaction breadcrumb - describing a tracing event.static @NotNull BreadcrumbCreates ui breadcrumb - a user interaction with your app's UI.static @NotNull BreadcrumbCreates user breadcrumb - a user interaction with your app's UI.static @NotNull BreadcrumbuserInteraction(@NotNull String subCategory, @Nullable String viewId, @Nullable String viewClass) Creates user breadcrumb - a user interaction with your app's UI.static @NotNull BreadcrumbuserInteraction(@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 BreadcrumbuserInteraction(@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 likeviewIdorviewClass. By default, the breadcrumb is captured withSentryLevelINFO 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 likeviewIdorviewClass. By default, the breadcrumb is captured withSentryLevelINFO 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 likeviewIdorviewClass. By default, the breadcrumb is captured withSentryLevelINFO 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:
getUnknownin interfaceJsonUnknown
-
setUnknown
- Specified by:
setUnknownin interfaceJsonUnknown
-
compareTo
- Specified by:
compareToin interfaceComparable<Breadcrumb>
-
serialize
public void serialize(@NotNull @NotNull ObjectWriter writer, @NotNull @NotNull ILogger logger) throws IOException - Specified by:
serializein interfaceJsonSerializable- Throws:
IOException
-