DatadogConfiguration constructor
DatadogConfiguration({
- required String clientToken,
- required String env,
- required DatadogSite site,
- bool nativeCrashReportEnabled = false,
- String? service,
- UploadFrequency? uploadFrequency,
- BatchSize? batchSize,
- BatchProcessingLevel? batchProcessingLevel,
- String? version,
- String? flavor,
- List<
String> ? firstPartyHosts, - Map<
String, Set< firstPartyHostsWithTracingHeaders = const {},TracingHeaderType> > - DatadogLoggingConfiguration? loggingConfiguration,
- DatadogRumConfiguration? rumConfiguration,
Implementation
DatadogConfiguration({
required this.clientToken,
required this.env,
required this.site,
this.nativeCrashReportEnabled = false,
this.service,
this.uploadFrequency,
this.batchSize,
this.batchProcessingLevel,
this.version,
this.flavor,
List<String>? firstPartyHosts,
this.firstPartyHostsWithTracingHeaders = const {},
this.loggingConfiguration,
this.rumConfiguration,
}) {
// Attempt a union if both configuration options are present
if (firstPartyHosts != null) {
// make map mutable in case it's the default
firstPartyHostsWithTracingHeaders =
Map<String, Set<TracingHeaderType>>.from(
firstPartyHostsWithTracingHeaders);
for (var entry in firstPartyHosts) {
final headerTypes = firstPartyHostsWithTracingHeaders[entry];
if (headerTypes == null) {
firstPartyHostsWithTracingHeaders[entry] = {
TracingHeaderType.datadog,
TracingHeaderType.tracecontext,
};
} else {
headerTypes.add(TracingHeaderType.datadog);
headerTypes.add(TracingHeaderType.tracecontext);
}
}
}
}