-
Notifications
You must be signed in to change notification settings - Fork 61
Datadog
object Datadog
This class initializes the Datadog SDK, and sets up communication with the server.
fun _internalProxy(instanceName: String? = null): _InternalProxy
For Datadog internal use only.
_InternalProxy |
fun addUserProperties(extraInfo: Map<String, Any?>, sdkCore: SdkCore = getInstance())
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.
extraInfo | additional information. An extra information can be nested up to 8 levels deep. Keys using more than 8 levels will be sanitized by SDK. |
sdkCore | SDK instance to add user properties. If not provided, default SDK instance will be used. |
fun clearAllData(sdkCore: SdkCore = getInstance())
Clears all unsent data in all registered features.
sdkCore | SDK instance to clear the data. If not provided, default SDK instance will be used. |
fun getInstance(instanceName: String? = null): SdkCore
Retrieve the initialized SDK instance attached to the given name, or the default instance if the name is null.
the existing instance linked with the given name, or no-op instance if instance with given name is not yet initialized.
instanceName | the name of the instance to retrieve, or null to get the default instance |
fun getVerbosity(): Int
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.
fun initialize(instanceName: String?, context: Context, configuration: Configuration, trackingConsent: TrackingConsent): SdkCore?
Initializes a named instance of the Datadog SDK.
the initialized SDK instance, or null if something prevents the SDK from being initialized
instanceName | the name of the instance (or null to initialize the default instance). Note that the instance name should be stable across builds. |
context | your application context |
configuration | the configuration for the SDK library |
trackingConsent | as the initial state of the tracking consent flag |
Configuration |
TrackingConsent |
IllegalArgumentException | if the env name is using illegal characters and your application is in debug mode otherwise returns null and stops initializing the SDK |
fun initialize(context: Context, configuration: Configuration, trackingConsent: TrackingConsent): SdkCore?
Initializes the Datadog SDK.
the initialized SDK instance, or null if something prevents the SDK from being initialized
context | your application context |
configuration | the configuration for the SDK library |
trackingConsent | as the initial state of the tracking consent flag |
Configuration |
TrackingConsent |
IllegalArgumentException | if the env name is using illegal characters and your application is in debug mode otherwise returns null and stops initializing the SDK |
fun isInitialized(instanceName: String? = null): Boolean
Checks if SDK instance with a given name is initialized.
whenever the instance with given name is initialized or not.
instanceName | the name of the instance to retrieve, or null to check the default instance |
fun setTrackingConsent(consent: TrackingConsent, sdkCore: SdkCore = getInstance())
Sets the tracking consent regarding the data collection for this instance of the Datadog SDK.
consent | which can take one of the values (TrackingConsent.PENDING, TrackingConsent.GRANTED, TrackingConsent.NOT_GRANTED) |
sdkCore | SDK instance to set tracking consent in. If not provided, default SDK instance will be used. |
fun setUserInfo(id: String? = null, name: String? = null, email: String? = null, extraInfo: Map<String, Any?> = emptyMap(), sdkCore: SdkCore = getInstance())
Sets the user information.
id | (nullable) a unique user identifier (relevant to your business domain) |
name | (nullable) the user name or alias |
(nullable) the user email | |
extraInfo | additional information. An extra information can be nested up to 8 levels deep. Keys using more than 8 levels will be sanitized by SDK. |
sdkCore | SDK instance to set user info in. If not provided, default SDK instance will be used. |
fun setVerbosity(level: Int)
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.
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). |
fun stopInstance(instanceName: String? = null)
Stop the initialized SDK instance attached to the given name, or the default instance if the name is null.
instanceName | the name of the instance to stop, or null to stop the default instance |
- Datadog
- DatadogSite
- _InternalProxy
- InternalLogger
- SdkCore
- DatadogContext
- DeviceInfo
- DeviceType
- NetworkInfo
- ProcessInfo
- TimeInfo
- UserInfo
- Feature
- FeatureContextUpdateReceiver
- FeatureEventReceiver
- FeatureScope
- FeatureSdkCore
- StorageBackedFeature
- Request
- RequestFactory
- DataWriter
- EventBatchWriter
- EventType
- FeatureStorageConfiguration
- RawBatchEvent
- DataStoreHandler
- DataStoreReadCallback
- DataStoreWriteCallback
- InternalSdkCore
- SdkReference
- BackPressureMitigation
- BackPressureStrategy
- BatchProcessingLevel
- BatchSize
- Configuration
- HostsSanitizer
- UploadFrequency
- UploadSchedulerStrategy
- DataConstraints
- DatadogDataConstraints
- ThreadDump
- DefaultFirstPartyHostHeaderTypeResolver
- FirstPartyHostHeaderTypeResolver
- Deserializer
- BuildSdkVersionProvider
- JsonSerializer
- MethodCallSamplingRate
- PerformanceMetric
- TelemetryMetricType
- PersistenceStrategy
- Serializer
- DataStoreContent
- RateBasedSampler
- Sampler
- FlushableExecutorService
- EventMapper
- MapperSerializer
- NoOpEventMapper
- LogAttributes
- TrackingConsent
- TrackingConsentProviderCallback
- Encryption
- TracingHeaderType
- DdRumContentProvider
- GlobalRumMonitor
- Rum
- RumActionType
- RumAttributes
- RumConfiguration
- RumErrorSource
- RumMonitor
- RumPerformanceMetric
- RumResourceAttributesProvider
- RumResourceKind
- RumResourceMethod
- RumSessionListener
- _RumInternalProxy
- VitalsUpdateFrequency
- ViewEventMapper
- ResourceTiming
- AdvancedNetworkRumMonitor
- ResourceId
- RumResourceInputStream
- AcceptAllActivities
- AcceptAllDefaultFragment
- AcceptAllNavDestinations
- AcceptAllSupportFragments
- ActivityLifecycleTrackingStrategy
- ActivityViewTrackingStrategy
- ComponentPredicate
- FragmentViewTrackingStrategy
- InteractionPredicate
- MixedViewTrackingStrategy
- NavigationViewTrackingStrategy
- TrackingStrategy
- ViewAttributesProvider
- ViewTrackingStrategy
- DatadogDatabaseErrorHandler
- ActionEvent
- ErrorEvent
- LongTaskEvent
- ResourceEvent
- ViewEvent
- TelemetryConfigurationEvent
- TelemetryDebugEvent
- TelemetryErrorEvent
- ExtensionSupport
- ImagePrivacy
- MapperTypeWrapper
- SessionReplay
- SessionReplayConfiguration
- SessionReplayPrivacy
- MappingContext
- OptionSelectorDetector
- SystemInformation
- BaseAsyncBackgroundWireframeMapper
- BaseViewGroupMapper
- BaseWireframeMapper
- EditTextMapper
- TextViewMapper
- TraverseAllChildrenMapper
- WireframeMapper
- AndroidMDrawableToColorMapper
- AndroidQDrawableToColorMapper
- AsyncJobStatusCallback
- ColorStringFormatter
- DefaultColorStringFormatter
- DefaultViewBoundsResolver
- DefaultViewIdentifierResolver
- DrawableToColorMapper
- GlobalBounds
- ImageWireframeHelper
- LegacyDrawableToColorMapper
- ViewBoundsResolver
- ViewIdentifierResolver
- MobileSegment
- ResourceHashesEntry
- ResourceMetadata