Package 

Object Datadog


  • 
    public class Datadog
    
                        

    This class initializes the Datadog SDK, and sets up communication with the server.

    • 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 context
        configuration - the configuration for the SDK library
        trackingConsent - 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 context
        configuration - the configuration for the SDK library
        trackingConsent - 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
      • 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.

      • 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.

      • 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 alias
        email - (nullable) the user email
        extraInfo - 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 alias
        email - (nullable) the user email
        extraInfo - 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 alias
        email - (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)
      • setUserInfoDeprecated

        @JvmOverloads()@Deprecated(message = UserInfo id property is now mandatory.) final static Unit setUserInfoDeprecated(String id, String name, String email, Map<String, Object> extraInfo, SdkCore sdkCore)

        Sets the information used to identify a real user.

        This API should be used to assign a stable identifier for the user, such as a user ID, email, or username. The information set here will be added to logs, traces and RUM events.

        Parameters:
        id - (nullable) a unique user identifier (relevant to your business domain)
        name - (nullable) the user name or alias
        email - (nullable) the user email
        extraInfo - additional information.
        sdkCore - SDK instance to set user info in.
      • setUserInfoDeprecated

        @JvmOverloads()@Deprecated(message = UserInfo id property is now mandatory.) final static Unit setUserInfoDeprecated(String id, String name, String email, Map<String, Object> extraInfo)

        Sets the information used to identify a real user.

        This API should be used to assign a stable identifier for the user, such as a user ID, email, or username. The information set here will be added to logs, traces and RUM events.

        Parameters:
        id - (nullable) a unique user identifier (relevant to your business domain)
        name - (nullable) the user name or alias
        email - (nullable) the user email
        extraInfo - additional information.
      • setUserInfoDeprecated

        @JvmOverloads()@Deprecated(message = UserInfo id property is now mandatory.) final static Unit setUserInfoDeprecated(String id, String name, String email)

        Sets the information used to identify a real user.

        This API should be used to assign a stable identifier for the user, such as a user ID, email, or username. The information set here will be added to logs, traces and RUM events.

        Parameters:
        id - (nullable) a unique user identifier (relevant to your business domain)
        name - (nullable) the user name or alias
        email - (nullable) the user email
      • setUserInfoDeprecated

        @JvmOverloads()@Deprecated(message = UserInfo id property is now mandatory.) final static Unit setUserInfoDeprecated(String id, String name)

        Sets the information used to identify a real user.

        This API should be used to assign a stable identifier for the user, such as a user ID, email, or username. The information set here will be added to logs, traces and RUM events.

        Parameters:
        id - (nullable) a unique user identifier (relevant to your business domain)
        name - (nullable) the user name or alias
      • setUserInfoDeprecated

        @JvmOverloads()@Deprecated(message = UserInfo id property is now mandatory.) final static Unit setUserInfoDeprecated(String id)

        Sets the information used to identify a real user.

        This API should be used to assign a stable identifier for the user, such as a user ID, email, or username. The information set here will be added to logs, traces and RUM events.

        Parameters:
        id - (nullable) a unique user identifier (relevant to your business domain)
      • setUserInfoDeprecated

        @JvmOverloads()@Deprecated(message = UserInfo id property is now mandatory.) final static Unit setUserInfoDeprecated()

        Sets the information used to identify a real user.

        This API should be used to assign a stable identifier for the user, such as a user ID, email, or username. The information set here will be added to logs, traces and RUM events.

      • 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.
      • 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 usr attribute cleared.

        If you want to retain the current usr on the active RUM session, you need to stop the session first by using GlobalRumMonitor.get().stopSession()

        If you want to retain the current usr on the active RUM views, you need to stop the view first by using GlobalRumMonitor.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 usr attribute cleared.

        If you want to retain the current usr on the active RUM session, you need to stop the session first by using GlobalRumMonitor.get().stopSession()

        If you want to retain the current usr on the active RUM views, you need to stop the view first by using GlobalRumMonitor.get().stopView().

      • 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's 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's 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's additional custom attributes.
        sdkCore - SDK instance to add account custom attributes.
      • 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's additional custom attributes.
      • addAccountExtraInfo

        @JvmOverloads() final static Unit addAccountExtraInfo()

        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.

      • clearAccountInfo

        @JvmOverloads() final static Unit clearAccountInfo(SdkCore sdkCore)

        Clear the current account information.

        Account information will 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 account attribute cleared

        If you want to retain the current account on the active RUM session, you need to stop the session first by using GlobalRumMonitor.get().stopSession()

        If you want to retain the current account on the active RUM views, you need to stop the view first by using GlobalRumMonitor.get().stopView().

        Parameters:
        sdkCore - SDK instance to clear account info.
      • clearAccountInfo

        @JvmOverloads() final static Unit clearAccountInfo()

        Clear the current account information.

        Account information will 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 account attribute cleared

        If you want to retain the current account on the active RUM session, you need to stop the session first by using GlobalRumMonitor.get().stopSession()

        If you want to retain the current account on the active RUM views, you need to stop the view first by using GlobalRumMonitor.get().stopView().