-
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 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 UnitclearUserInfo(SdkCore sdkCore)Clear the current user information. final static UnitclearUserInfo()Clear the current user information. 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 static UnitsetAccountInfo(String id, String name, Map<String, Object> extraInfo, SdkCore sdkCore)Sets the account information that the user is currently logged into. final static UnitsetAccountInfo(String id, String name, Map<String, Object> extraInfo)Sets the account information that the user is currently logged into. final static UnitsetAccountInfo(String id, String name)Sets the account information that the user is currently logged into. final static UnitsetAccountInfo(String id)Sets the account information that the user is currently logged into. final static UnitaddAccountExtraInfo(Map<String, Object> extraInfo, SdkCore sdkCore)Add custom attributes to the current account information. final static UnitaddAccountExtraInfo(Map<String, Object> extraInfo)Add custom attributes to the current account information. final static UnitclearAccountInfo(SdkCore sdkCore)Clear the current account information. final static UnitclearAccountInfo()Clear the current account information. 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- 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- 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- 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- 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- a unique user identifier (relevant to your business domain)
-
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.
-
clearUserInfo
@JvmOverloads()@AnyThread() final static Unit clearUserInfo(SdkCore sdkCore)
Clear the current user information.
User information will be set to null. After calling this api, Logs, Traces, RUM Events will not include the user information anymore.
Any active RUM Session, active RUM View at the time of call will have their
usrattribute cleared.If you want to retain the current
usron the active RUM session, you need to stop the session first by usingGlobalRumMonitor.get().stopSession()If you want to retain the current
usron the active RUM views, you need to stop the view first by usingGlobalRumMonitor.get().stopView().- Parameters:
sdkCore- SDK instance to clear user info.
-
clearUserInfo
@JvmOverloads()@AnyThread() final static Unit clearUserInfo()
Clear the current user information.
User information will be set to null. After calling this api, Logs, Traces, RUM Events will not include the user information anymore.
Any active RUM Session, active RUM View at the time of call will have their
usrattribute cleared.If you want to retain the current
usron the active RUM session, you need to stop the session first by usingGlobalRumMonitor.get().stopSession()If you want to retain the current
usron the active RUM views, you need to stop the view first by usingGlobalRumMonitor.get().stopView().
-
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.
-
setAccountInfo
@JvmOverloads() final static Unit setAccountInfo(String id, String name, Map<String, Object> extraInfo, SdkCore sdkCore)
Sets the account information that the user is currently logged into.
This API should be used to assign an identifier for the user's account which represents a contextual identity within the app, typically tied to business or tenant logic. The information set here will be added to logs, traces and RUM events.
This value should be set when user logs in with his account, and cleared by calling clearAccountInfo when he logs out.
- Parameters:
id- Account ID.name- representing the account, if exists.extraInfo- Account custom attributes, if exists.sdkCore- SDK instance to set account information.
-
setAccountInfo
@JvmOverloads() final static Unit setAccountInfo(String id, String name, Map<String, Object> extraInfo)
Sets the account information that the user is currently logged into.
This API should be used to assign an identifier for the user's account which represents a contextual identity within the app, typically tied to business or tenant logic. The information set here will be added to logs, traces and RUM events.
This value should be set when user logs in with his account, and cleared by calling clearAccountInfo when he logs out.
- Parameters:
id- Account ID.name- representing the account, if exists.extraInfo- Account custom attributes, if exists.
-
setAccountInfo
@JvmOverloads() final static Unit setAccountInfo(String id, String name)
Sets the account information that the user is currently logged into.
This API should be used to assign an identifier for the user's account which represents a contextual identity within the app, typically tied to business or tenant logic. The information set here will be added to logs, traces and RUM events.
This value should be set when user logs in with his account, and cleared by calling clearAccountInfo when he logs out.
- Parameters:
id- Account ID.name- representing the account, if exists.
-
setAccountInfo
@JvmOverloads() final static Unit setAccountInfo(String id)
Sets the account information that the user is currently logged into.
This API should be used to assign an identifier for the user's account which represents a contextual identity within the app, typically tied to business or tenant logic. The information set here will be added to logs, traces and RUM events.
This value should be set when user logs in with his account, and cleared by calling clearAccountInfo when he logs out.
- Parameters:
id- Account ID.
-
addAccountExtraInfo
@JvmOverloads() final static Unit addAccountExtraInfo(Map<String, Object> extraInfo, SdkCore sdkCore)
Add custom attributes to the current account information.
This extra info will be added to already existing extra info that is added to Logs, Traces and RUM events automatically.
- Parameters:
extraInfo- Account additional custom attributes.sdkCore- SDK instance to add extra account information.
-
addAccountExtraInfo
@JvmOverloads() final static Unit addAccountExtraInfo(Map<String, Object> extraInfo)
Add custom attributes to the current account information.
This extra info will be added to already existing extra info that is added to Logs, Traces and RUM events automatically.
- Parameters:
extraInfo- Account additional custom attributes.
-
clearAccountInfo
@JvmOverloads() final static Unit clearAccountInfo(SdkCore sdkCore)
Clear the current account information.
Account information will be set to null. Following Logs, Traces, RUM Events will not include the account information anymore.
Any active RUM Session, active RUM View at the time of call will have their
accountattribute cleared.If you want to retain the current
accounton the active RUM session, you need to stop the session first by usingGlobalRumMonitor.get().stopSession().If you want to retain the current
accounton the active RUM views, you need to stop the view first by usingGlobalRumMonitor.get().stopView().- Parameters:
sdkCore- SDK instance to clear account information.
-
clearAccountInfo
@JvmOverloads() final static Unit clearAccountInfo()
Clear the current account information.
Account information will be set to null. Following Logs, Traces, RUM Events will not include the account information anymore.
Any active RUM Session, active RUM View at the time of call will have their
accountattribute cleared.If you want to retain the current
accounton the active RUM session, you need to stop the session first by usingGlobalRumMonitor.get().stopSession().If you want to retain the current
accounton the active RUM views, you need to stop the view first by usingGlobalRumMonitor.get().stopView().
-
_internalProxy
final _InternalProxy _internalProxy(String instanceName)
For Datadog internal use only.
-
-
-
-