DatadogSdk class

A singleton for the Datadog SDK.

Once initialized, individual features can be access through the logs and rum member variables. If a feature is disabled (either because they were not configured or the SDK has not been initialized) the member variables will default to null

Available Extensions

Properties

configuration DatadogConfiguration?
no setter
firstPartyHosts List<FirstPartyHost>
An unmodifiable list of first party hosts for tracing.
no setter
hashCode int
The hash code for this object.
no setterinherited
internalLogger InternalLogger
Logger used internally by Datadog to report errors.
final
logs DatadogLogging?
no setter
platform DatadogSdkPlatform
Internal extension access to the configured platform
no setter
rum DatadogRum?
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sdkVerbosity CoreLoggerLevel
Set the verbosity of the Datadog SDK. Set to CoreLoggerLevel.warn by default. All internal logging is enabled only when kDebugMode is set.
getter/setter pair

Methods

addUserExtraInfo(Map<String, Object?> extraInfo) → void
Add custom attributes to the current user information
attachToExisting(DatadogAttachConfiguration config) Future<void>
Attach the Datadog Flutter SDK to an already initialized Datadog Native (iOS or Android) SDK. This is used for "app in app" embedding of Flutter.
clearAllData() → void
Clears all data that has not already been sent to Datadog servers.
flushAndDeinitialize() Future<void>
This function is not part of the public interface for Datadog, and may not be available in all targets. Used for integration and E2E testing purposes only.
getPlugin<T>() → T?
Get an instance of a DatadogPlugin that was registered with DatadogConfiguration.addPlugin
headerTypesForHost(Uri uri) Set<TracingHeaderType>
initialize(DatadogConfiguration configuration, TrackingConsent trackingConsent) Future<void>
Initialize the DatadogSdk with the provided configuration.
isFirstPartyHost(Uri uri) bool
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setTrackingConsent(TrackingConsent trackingConsent) → void
setUserInfo({String? id, String? name, String? email, Map<String, Object?> extraInfo = const {}}) → void
Sets current user information. User information will be added traces and RUM events automatically.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance DatadogSdk
no setter
sdkVersion String
The version of this SDK.
no setter

Static Methods

initializeForTesting() → void
Set Datadog to use No Op platform implementations.
runApp(DatadogConfiguration configuration, TrackingConsent trackingConsent, AppRunner runner) Future<void>
A helper function that will initialize Datadog and setup error reporting