Embrace
Entry point for the SDK. This class is part of the Embrace Public API.
Contains a singleton instance of itself, and is used for initializing the SDK.
Types
Functions
Link copied to clipboard
Adds a breadcrumb.
Link copied to clipboard
Adds a [LogRecordExporter] to the open telemetry logger.
Link copied to clipboard
public boolean addSessionProperty(@NonNull() String key, @NonNull() String value, boolean permanent)
Adds a property to the current session, overwriting any previous property set with the given key.
Link copied to clipboard
Adds a [SpanExporter] to the tracer.
Link copied to clipboard
Adds a custom user persona.
Link copied to clipboard
Clears all custom user personas from the user.
Link copied to clipboard
Clears this user as a paying user.
Link copied to clipboard
Clears the currently set user's email address.
Link copied to clipboard
Clears the currently set user ID.
Link copied to clipboard
Clears the username of the currently logged in user, for example if the user has logged out.
Link copied to clipboard
Clears the custom user persona, if it is set.
Link copied to clipboard
Create an EmbraceSpan with the given name that will be the root span of a new trace.
Create an EmbraceSpan with the given name and parent.
Link copied to clipboard
Signals that the app has completed startup.
Link copied to clipboard
Ends the current session and starts a new one.
Link copied to clipboard
Randomly generate a W3C-compliant traceparent
Link copied to clipboard
Get the ID for the current session.
Link copied to clipboard
Get the user identifier assigned to the device by Embrace
Link copied to clipboard
Gets the singleton instance of the Embrace SDK.
Link copied to clipboard
Get the end state of the last run of the application.
Link copied to clipboard
Retrieves a map of the current session properties.
Link copied to clipboard
Return the EmbraceSpan corresponding to the given spanId if it is active or it has completed in the current session.
Link copied to clipboard
Retrieve the HTTP request header to extract trace ID from.
Link copied to clipboard
Link copied to clipboard
Remotely logs a custom stacktrace at ERROR level.
public void logCustomStacktrace(@NonNull() Array<StackTraceElement> stacktraceElements, @NonNull() Severity severity)
public void logCustomStacktrace(@NonNull() Array<StackTraceElement> stacktraceElements, @NonNull() Severity severity, @Nullable() Map<String, ? extends Object> properties)
public void logCustomStacktrace(@NonNull() Array<StackTraceElement> stacktraceElements, @NonNull() Severity severity, @Nullable() Map<String, ? extends Object> properties, @Nullable() String message)
Remotely logs a custom stacktrace at given severity level.
Link copied to clipboard
Remotely logs a Throwable/Exception at ERROR level.
public void logException(@NonNull() Throwable throwable, @NonNull() Severity severity, @Nullable() Map<String, ? extends Object> properties)
public void logException(@NonNull() Throwable throwable, @NonNull() Severity severity, @Nullable() Map<String, ? extends Object> properties, @Nullable() String message)
Remotely logs a Throwable/Exception at given severity level.
Link copied to clipboard
Link copied to clipboard
public void logPushNotification(@Nullable() String title, @Nullable() String body, @Nullable() String topic, @Nullable() String id, @Nullable() Integer notificationPriority, @NonNull() Integer messageDeliveredPriority, @NonNull() Boolean isNotification, @NonNull() Boolean hasData)
Saves captured push notification information into session payload
Link copied to clipboard
Remotely logs a message at WARN level.
Link copied to clipboard
public boolean recordCompletedSpan(@NonNull() String name, long startTimeMs, long endTimeMs, @Nullable() Map<String, String> attributes, @Nullable() List<EmbraceSpanEvent> events)
Record a span with the given name, start time, and end time (epoch time in milliseconds).
public boolean recordCompletedSpan(@NonNull() String name, long startTimeMs, long endTimeMs, @Nullable() EmbraceSpan parent)
Record a span with the given name, parent, start time, and end time (epoch time in milliseconds).
public boolean recordCompletedSpan(@NonNull() String name, long startTimeMs, long endTimeMs, @Nullable() ErrorCode errorCode)
Record a span with the given name, error code, start time, and end time (epoch time in milliseconds).
public boolean recordCompletedSpan(@NonNull() String name, long startTimeMs, long endTimeMs, @Nullable() ErrorCode errorCode, @Nullable() EmbraceSpan parent)
Record a span with the given name, parent, error code, start time, and end time (epoch time in milliseconds).
public boolean recordCompletedSpan(@NonNull() String name, long startTimeMs, long endTimeMs, @Nullable() ErrorCode errorCode, @Nullable() EmbraceSpan parent, @Nullable() Map<String, String> attributes, @Nullable() List<EmbraceSpanEvent> events)
Record a span with the given name, error code, parent, start time, and end time (epoch time in milliseconds).
Link copied to clipboard
Logs the fact that a network call occurred.
Link copied to clipboard
Execute the given block of code and record a new trace around it.
public T recordSpan<T>(@NonNull() String name, @Nullable() EmbraceSpan parent, @NonNull() Function0<? extends T> code)
Execute the given block of code and record a new span around it with the given parent.
public T recordSpan<T>(@NonNull() String name, @Nullable() Map<String, String> attributes, @Nullable() List<EmbraceSpanEvent> events, @NonNull() Function0<? extends T> code)
Execute the given block of code and record a new trace around it with optional attributes and list of EmbraceSpanEvent.
public T recordSpan<T>(@NonNull() String name, @Nullable() EmbraceSpan parent, @Nullable() Map<String, String> attributes, @Nullable() List<EmbraceSpanEvent> events, @NonNull() Function0<? extends T> code)
Execute the given block of code and record a new span around it with the given parent with optional attributes and list of EmbraceSpanEvent.
Link copied to clipboard
Removes a property from the current session.
Link copied to clipboard
Sets this user as a paying user.
Link copied to clipboard
Sets the current user's email address.
Link copied to clipboard
Sets the user ID.
Link copied to clipboard
Sets the username of the currently logged in user.
Link copied to clipboard
public void start(@NonNull() Context context, boolean enableIntegrationTesting, @NonNull() Embrace.AppFramework appFramework)
Starts instrumentation of the Android application using the Embrace SDK.
Link copied to clipboard
Link copied to clipboard
Create, start, and return a new EmbraceSpan with the given name that will be the root span of a new trace.
Create, start, and return a new EmbraceSpan with the given name and parent.
public EmbraceSpan startSpan(@NonNull() String name, @Nullable() EmbraceSpan parent, @Nullable() Long startTimeMs)
Create, start, and return a new EmbraceSpan with the given name, parent, and start time (epoch time in milliseconds).
Link copied to clipboard
public void trackWebViewPerformance(@NonNull() String tag, @NonNull() ConsoleMessage consoleMessage)
Listen to performance-tracking JavaScript previously embedded in the website's code.