-
Notifications
You must be signed in to change notification settings - Fork 61
Configuration.Builder
class Builder@JvmOverloadsconstructor(clientToken: String, env: String, variant: String = NO_VARIANT, service: String? = null)
A Builder class for a Configuration.
clientToken | your API key of type Client Token |
env | the environment name that will be sent with each event. This can be used to filter your events on different environments (e.g.: "staging" vs. "production"). |
variant | the variant of your application, which should be the value from your BuildConfig.FLAVOR constant if you have different flavors, empty string otherwise. |
service | the service name (if set to null, it'll be set to your application's package name, e.g.: com.example.android) |
constructor(clientToken: String, env: String, variant: String = NO_VARIANT, service: String? = null)
clientToken | your API key of type Client Token |
env | the environment name that will be sent with each event. This can be used to filter your events on different environments (e.g.: "staging" vs. "production"). |
variant | the variant of your application, which should be the value from your BuildConfig.FLAVOR constant if you have different flavors, empty string otherwise. |
service | the service name (if set to null, it'll be set to your application's package name, e.g.: com.example.android) |
fun build(): Configuration
Builds a Configuration based on the current state of this Builder.
fun setAdditionalConfiguration(additionalConfig: Map<String, Any>): Configuration.Builder
Allows to provide additional configuration values which can be used by the SDK.
additionalConfig | Additional configuration values. |
fun setBackpressureStrategy(backpressureStrategy: BackPressureStrategy): Configuration.Builder
Sets the strategy to handle scalability issues. Many operations (data processing, event I/O, …) are queued in background threads. This configuration lets one decide how to handle the edge case when the queue starts growing, which can lead to a lot of memory usage, delayed processing, and possibly OOM or ANR.
backpressureStrategy | the backpressure strategy (default strategy ignores new tasks if a queue reaches 1024 items) |
fun setBatchProcessingLevel(batchProcessingLevel: BatchProcessingLevel): Configuration.Builder
Defines the Batch processing level, defining the maximum number of batches processed sequentially without a delay within one reading/uploading cycle.
batchProcessingLevel | the desired batch processing level. By default it's set to BatchProcessingLevel.MEDIUM. |
BatchProcessingLevel |
fun setBatchSize(batchSize: BatchSize): Configuration.Builder
Defines the batch size (impacts the size and number of requests performed by Datadog).
batchSize | the desired batch size |
fun setCrashReportsEnabled(crashReportsEnabled: Boolean): Configuration.Builder
Allows to control if JVM crashes are tracked or not. Default value is true
.
crashReportsEnabled | whether crashes are tracked and sent to Datadog |
fun setEncryption(dataEncryption: Encryption): Configuration.Builder
Allows to set the encryption for the local data. By default no encryption is used for the local data.
dataEncryption | An encryption object complying Encryption interface. |
fun setFirstPartyHosts(hosts: List<String>): Configuration.Builder
Sets the list of first party hosts. Requests made to a URL with any one of these hosts (or any subdomain) will:
- be considered a first party resource and categorised as such in your RUM dashboard;
- be wrapped in a Span and have DataDog trace id injected to get a full flame-graph in APM in case of OkHttp instrumentation usage.
hosts | a list of all the hosts that you own. |
fun setFirstPartyHostsWithHeaderType(hostsWithHeaderType: Map<String, Set<TracingHeaderType>>): Configuration.Builder
Sets the list of first party hosts and specifies the type of HTTP headers used for distributed tracing. Requests made to a URL with any one of these hosts (or any subdomain) will:
- be considered a first party resource and categorised as such in your RUM dashboard;
- be wrapped in a Span and have trace id of the specified types injected to get a full flame-graph in APM. Multiple header types are supported for each host.
hostsWithHeaderType | a list of all the hosts that you own and the tracing headers to be used for each host. See DatadogInterceptor |
fun setPersistenceStrategyFactory(persistenceStrategyFactory: PersistenceStrategy.Factory?): Configuration.Builder
Allows to use a custom persistence strategy.
persistenceStrategyFactory | the persistence strategy to use (or null to use the default one) |
fun setProxy(proxy: Proxy, authenticator: Authenticator?): Configuration.Builder
Enables a custom proxy for uploading tracked data to Datadog's intake.
proxy | the Proxy configuration |
authenticator | the optional Authenticator for the proxy |
fun setUploadFrequency(uploadFrequency: UploadFrequency): Configuration.Builder
Defines the preferred upload frequency.
uploadFrequency | the desired upload frequency policy |
fun setUploadSchedulerStrategy(uploadSchedulerStrategy: UploadSchedulerStrategy?): Configuration.Builder
Sets the strategy to schedule data uploads.
uploadSchedulerStrategy | the upload scheduler strategy, or null to use the default strategy (default: null) |
fun setUseDeveloperModeWhenDebuggable(developerModeEnabled: Boolean): Configuration.Builder
Sets the DataDog SDK to be more verbose when an application is set to debuggable
. This is equivalent to setting: setSessionSampleRate(100) setBatchSize(BatchSize.SMALL) setUploadFrequency(UploadFrequency.FREQUENT) Datadog.setVerbosity(Log.VERBOSE) These settings will override your configuration, but only when the application is debuggable
developerModeEnabled | Enable or disable extra debug info when an app is debuggable |
fun useSite(site: DatadogSite): Configuration.Builder
Let the SDK target your preferred Datadog's site.
- 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