-
public class DatadogThis class initializes the Datadog SDK, and sets up communication with the server.
-
-
Method Summary
Modifier and Type Method Description final static SdkCoreinitialize(String instanceName, Context context, Configuration configuration, TrackingConsent trackingConsent)Initializes a named instance of the Datadog SDK. final static SdkCoreinitialize(Context context, Configuration configuration, TrackingConsent trackingConsent)Initializes the Datadog SDK. final static SdkCoregetInstance(String instanceName)Retrieve the initialized SDK instance attached to the given name, or the default instance if the name is null. final static SdkCoregetInstance()Retrieve the initialized SDK instance attached to the given name, or the default instance if the name is null. final static BooleanisInitialized(String instanceName)Checks if SDK instance with a given name is initialized. final static BooleanisInitialized()Checks if SDK instance with a given name is initialized. final static UnitstopInstance(String instanceName)Stop the initialized SDK instance attached to the given name, or the default instance if the name is null. final static UnitstopInstance()Stop the initialized SDK instance attached to the given name, or the default instance if the name is null. final static UnitsetVerbosity(Integer level)Sets the verbosity of this instance of the Datadog SDK. final static IntegergetVerbosity()Gets the verbosity of this instance of the Datadog SDK. final static UnitsetTrackingConsent(TrackingConsent consent, SdkCore sdkCore)Sets the tracking consent regarding the data collection for this instance of the Datadog SDK. final static UnitsetTrackingConsent(TrackingConsent consent)Sets the tracking consent regarding the data collection for this instance of the Datadog SDK. final static UnitsetUserInfo(String id, String name, String email, Map<String, Object> extraInfo, SdkCore sdkCore)Sets the user information. final static UnitsetUserInfo(String id, String name, String email, Map<String, Object> extraInfo)Sets the user information. final static UnitsetUserInfo(String id, String name, String email)Sets the user information. final static UnitsetUserInfo(String id, String name)Sets the user information. final static UnitsetUserInfo(String id)Sets the user information. final static UnitsetUserInfo()Sets the user information. final static UnitaddUserProperties(Map<String, Object> extraInfo, SdkCore sdkCore)Sets additional information on the UserInfo objectIf properties had originally been set with SdkCore.setUserInfo, they will be preserved. final static UnitaddUserProperties(Map<String, Object> extraInfo)Sets additional information on the UserInfo objectIf properties had originally been set with SdkCore.setUserInfo, they will be preserved. final static UnitclearAllData(SdkCore sdkCore)Clears all unsent data in all registered features. final static UnitclearAllData()Clears all unsent data in all registered features. final _InternalProxy_internalProxy(String instanceName)For Datadog internal use only. -
-
Method Detail
-
initialize
final static SdkCore initialize(String instanceName, Context context, Configuration configuration, TrackingConsent trackingConsent)
Initializes a named instance of the Datadog SDK.
- Parameters:
instanceName- the name of the instance (or null to initialize the default instance).context- your application contextconfiguration- the configuration for the SDK librarytrackingConsent- as the initial state of the tracking consent flag
-
initialize
final static SdkCore initialize(Context context, Configuration configuration, TrackingConsent trackingConsent)
Initializes the Datadog SDK.
- Parameters:
context- your application contextconfiguration- the configuration for the SDK librarytrackingConsent- as the initial state of the tracking consent flag
-
getInstance
@JvmOverloads() final static SdkCore getInstance(String instanceName)
Retrieve the initialized SDK instance attached to the given name, or the default instance if the name is null.
- Parameters:
instanceName- the name of the instance to retrieve, or null to get the default instance
-
getInstance
@JvmOverloads() final static SdkCore getInstance()
Retrieve the initialized SDK instance attached to the given name, or the default instance if the name is null.
-
isInitialized
@JvmOverloads() final static Boolean isInitialized(String instanceName)
Checks if SDK instance with a given name is initialized.
- Parameters:
instanceName- the name of the instance to retrieve, or null to check the default instance
-
isInitialized
@JvmOverloads() final static Boolean isInitialized()
Checks if SDK instance with a given name is initialized.
-
stopInstance
@JvmOverloads() final static Unit stopInstance(String instanceName)
Stop the initialized SDK instance attached to the given name, or the default instance if the name is null.
- Parameters:
instanceName- the name of the instance to stop, or null to stop the default instance
-
stopInstance
@JvmOverloads() final static Unit stopInstance()
Stop the initialized SDK instance attached to the given name, or the default instance if the name is null.
-
setVerbosity
final static Unit setVerbosity(Integer level)
Sets the verbosity of this instance of the Datadog SDK.
Messages with a priority level equal or above the given level will be sent to Android's Logcat.
- Parameters:
level- one of the Android android.util.Log constants (android.util.Log.VERBOSE, android.util.Log.DEBUG, android.util.Log.INFO, android.util.Log.WARN, android.util.Log.ERROR, android.util.Log.ASSERT).
-
getVerbosity
final static Integer getVerbosity()
Gets the verbosity of this instance of the Datadog SDK.
Messages with a priority level equal or above the given level will be sent to Android's Logcat.
-
setTrackingConsent
@JvmOverloads() final static Unit setTrackingConsent(TrackingConsent consent, SdkCore sdkCore)
Sets the tracking consent regarding the data collection for this instance of the Datadog SDK.
- Parameters:
consent- which can take one of the values (TrackingConsent.PENDING, TrackingConsent.GRANTED, TrackingConsent.NOT_GRANTED)sdkCore- SDK instance to set tracking consent in.
-
setTrackingConsent
@JvmOverloads() final static Unit setTrackingConsent(TrackingConsent consent)
Sets the tracking consent regarding the data collection for this instance of the Datadog SDK.
- Parameters:
consent- which can take one of the values (TrackingConsent.PENDING, TrackingConsent.GRANTED, TrackingConsent.NOT_GRANTED)
-
setUserInfo
@JvmOverloads() final static Unit setUserInfo(String id, String name, String email, Map<String, Object> extraInfo, SdkCore sdkCore)
Sets the user information.
- Parameters:
id- (nullable) a unique user identifier (relevant to your business domain)name- (nullable) the user name or aliasemail- (nullable) the user emailextraInfo- additional information.sdkCore- SDK instance to set user info in.
-
setUserInfo
@JvmOverloads() final static Unit setUserInfo(String id, String name, String email, Map<String, Object> extraInfo)
Sets the user information.
- Parameters:
id- (nullable) a unique user identifier (relevant to your business domain)name- (nullable) the user name or aliasemail- (nullable) the user emailextraInfo- additional information.
-
setUserInfo
@JvmOverloads() final static Unit setUserInfo(String id, String name, String email)
Sets the user information.
- Parameters:
id- (nullable) a unique user identifier (relevant to your business domain)name- (nullable) the user name or aliasemail- (nullable) the user email
-
setUserInfo
@JvmOverloads() final static Unit setUserInfo(String id, String name)
Sets the user information.
- Parameters:
id- (nullable) a unique user identifier (relevant to your business domain)name- (nullable) the user name or alias
-
setUserInfo
@JvmOverloads() final static Unit setUserInfo(String id)
Sets the user information.
- Parameters:
id- (nullable) a unique user identifier (relevant to your business domain)
-
setUserInfo
@JvmOverloads() final static Unit setUserInfo()
Sets the user information.
-
addUserProperties
@JvmOverloads() final static Unit addUserProperties(Map<String, Object> extraInfo, SdkCore sdkCore)
Sets additional information on the UserInfo object
If properties had originally been set with SdkCore.setUserInfo, they will be preserved. In the event of a conflict on key, the new property will prevail.
- Parameters:
extraInfo- additional information.sdkCore- SDK instance to add user properties.
-
addUserProperties
@JvmOverloads() final static Unit addUserProperties(Map<String, Object> extraInfo)
Sets additional information on the UserInfo object
If properties had originally been set with SdkCore.setUserInfo, they will be preserved. In the event of a conflict on key, the new property will prevail.
- Parameters:
extraInfo- additional information.
-
clearAllData
@JvmOverloads()@AnyThread() final static Unit clearAllData(SdkCore sdkCore)
Clears all unsent data in all registered features.
- Parameters:
sdkCore- SDK instance to clear the data.
-
clearAllData
@JvmOverloads()@AnyThread() final static Unit clearAllData()
Clears all unsent data in all registered features.
-
_internalProxy
final _InternalProxy _internalProxy(String instanceName)
For Datadog internal use only.
-
-
-
-