-
Notifications
You must be signed in to change notification settings - Fork 7
/
EmbraceApi.java
98 lines (85 loc) · 3.09 KB
/
EmbraceApi.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package io.embrace.android.embracesdk;
import android.webkit.ConsoleMessage;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import io.embrace.android.embracesdk.spans.TracingApi;
import io.opentelemetry.sdk.trace.export.SpanExporter;
/**
* Declares the functions that consist of Embrace's public API. You should not use
* {@link EmbraceApi} directly or implement it in your own custom classes,
* as new functions may be added in future. Use the {@link Embrace} class instead.
*/
interface EmbraceApi extends LogsApi, MomentsApi, NetworkRequestApi, SessionApi, UserApi, TracingApi {
/**
* Sets a custom app ID that overrides the one specified at build time. Must be called before
* the SDK is started.
*
* @param appId custom app ID
* @return true if the app ID could be set, false otherwise.
*/
boolean setAppId(@NonNull String appId);
/**
* Adds a breadcrumb.
* <p>
* Breadcrumbs track a user's journey through the application and will be shown on the timeline.
*
* @param message the name of the breadcrumb to log
*/
void addBreadcrumb(@NonNull String message);
/**
* Retrieve the HTTP request header to extract trace ID from.
*
* @return the Trace ID header.
*/
@NonNull
String getTraceIdHeader();
/**
* Randomly generate a W3C-compliant traceparent
*/
@NonNull
String generateW3cTraceparent();
/**
* Get the user identifier assigned to the device by Embrace
*
* @return the device identifier created by Embrace
*/
@NonNull
String getDeviceId();
/**
* Listen to performance-tracking JavaScript previously embedded in the website's code.
* The WebView being tracked must have JavaScript enabled.
*
* @param tag a name used to identify the WebView being tracked
* @param consoleMessage the console message collected from the WebView
*/
void trackWebViewPerformance(@NonNull String tag, @NonNull ConsoleMessage consoleMessage);
/**
* Listen to performance-tracking JavaScript previously embedded in the website's code.
* The WebView being tracked must have JavaScript enabled.
*
* @param tag a name used to identify the WebView being tracked
* @param message the console message collected from the WebView
*/
void trackWebViewPerformance(@NonNull String tag, @NonNull String message);
/**
* Get the ID for the current session.
* Returns null if a session has not been started yet or the SDK hasn't been initialized.
*
* @return The ID for the current Session, if available.
*/
@Nullable
String getCurrentSessionId();
/**
* Get the end state of the last run of the application.
*
* @return LastRunEndState enum value representing the end state of the last run.
*/
@NonNull
Embrace.LastRunEndState getLastRunEndState();
/**
* Adds a [SpanExporter] to the tracer.
*
* @param spanExporter the span exporter to add
*/
void addSpanExporter(@NonNull SpanExporter spanExporter);
}