Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion NATIVE_SDK_VERSIONS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| React Native | iOS Bridge / iOS SDK | Android Bridge / Android SDK |
|-------------|---------------------|-----------------------------|
| Unreleased | 3.16.1 | 3.16.0 |
| 3.11.0 | 3.16.1 | 3.15.0 |
| 3.10.0 | 3.16.0 | 3.13.1 |
| 3.9.0 | 3.16.0 | 3.13.1 |
Expand Down Expand Up @@ -84,4 +85,4 @@
| 1.6.0 | 1.19.0 | 1.19.0 |
| 1.5.2 | 1.19.0 | 1.18.1 |
| 1.5.1 | 1.16.0 | 1.18.1 |
| 1.5.0 | 1.16.0 | 1.18.1 |
| 1.5.0 | 1.16.0 | 1.18.1 |
4 changes: 2 additions & 2 deletions benchmarks/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ dependencies {

// Benchmark tools from dd-sdk-android are used for vitals recording
// Remember to bump this alongside the main dd-sdk-android dependencies
implementation("com.datadoghq:dd-sdk-android-benchmark-internal:3.15.0")
implementation("com.datadoghq:dd-sdk-android-benchmark-internal:3.16.0")
// Required for compile-time access to Datadog.getInstance() required by BenchmarkVitalsModuleImpl
implementation("com.datadoghq:dd-sdk-android-core:3.15.0")
implementation("com.datadoghq:dd-sdk-android-core:3.16.0")
}
18 changes: 9 additions & 9 deletions packages/core/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ dependencies {
// This breaks builds if the React Native target is below 0.76.0. as it relies on Gradle 8.5.0.
// To avoid this, we enforce 1.0.0-beta01 on RN < 0.76.0
if (reactNativeMinorVersion < 76) {
implementation("com.datadoghq:dd-sdk-android-rum:3.15.0") {
implementation("com.datadoghq:dd-sdk-android-rum:3.16.0") {
exclude group: "androidx.metrics", module: "metrics-performance"
}
implementation "androidx.metrics:metrics-performance:1.0.0-beta01"
Expand All @@ -233,15 +233,15 @@ dependencies {
}
}
} else {
implementation "com.datadoghq:dd-sdk-android-rum:3.15.0"
implementation "com.datadoghq:dd-sdk-android-rum:3.16.0"
}
implementation "com.datadoghq:dd-sdk-android-logs:3.15.0"
implementation "com.datadoghq:dd-sdk-android-trace:3.15.0"
implementation "com.datadoghq:dd-sdk-android-webview:3.15.0"
implementation "com.datadoghq:dd-sdk-android-ndk:3.15.0"
implementation "com.datadoghq:dd-sdk-android-flags:3.15.0"
implementation "com.datadoghq:dd-sdk-android-internal:3.15.0"
implementation "com.datadoghq:dd-sdk-android-rum-prelaunch:3.15.0"
implementation "com.datadoghq:dd-sdk-android-logs:3.16.0"
implementation "com.datadoghq:dd-sdk-android-trace:3.16.0"
implementation "com.datadoghq:dd-sdk-android-webview:3.16.0"
implementation "com.datadoghq:dd-sdk-android-ndk:3.16.0"
implementation "com.datadoghq:dd-sdk-android-flags:3.16.0"
implementation "com.datadoghq:dd-sdk-android-internal:3.16.0"
implementation "com.datadoghq:dd-sdk-android-rum-prelaunch:3.16.0"
implementation "com.google.code.gson:gson:2.11.0"
testImplementation "org.junit.platform:junit-platform-launcher:1.6.2"
testImplementation "org.junit.jupiter:junit-jupiter-api:5.6.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,87 @@ class DdFlagsImplementation(
promise.resolve(null)
}

/**
* Track a flag exposure without recording an evaluation event or updating RUM.
* @param clientName The name of the client.
* @param key The key of the flag.
* @param rawFlag The flag assignment from JavaScript.
* @param targetingKey The targeting key.
* @param attributes The attributes for the evaluation context.
* @param promise The promise to resolve after the native call, without waiting for upload.
*/
@Suppress("LongParameterList")
fun trackExposure(
clientName: String,
key: String,
rawFlag: ReadableMap,
targetingKey: String,
attributes: ReadableMap,
promise: Promise,
) {
_FlagsInternalProxy(getClient(clientName)).trackFlagExposure(
key,
convertMapToUnparsedFlag(rawFlag.toMap()),
buildEvaluationContext(targetingKey, attributes),
)
promise.resolve(null)
}

/**
* Track an evaluation event without recording an exposure or updating RUM.
* @param clientName The name of the client.
* @param key The key of the flag.
* @param rawFlag The flag assignment from JavaScript, if available.
* @param targetingKey The targeting key.
* @param attributes The attributes for the evaluation context.
* @param errorCode The evaluation error code, or null for a successful evaluation.
* @param promise The promise to resolve after the native call, without waiting for upload.
*/
@Suppress("LongParameterList")
fun trackEvaluationEvent(
clientName: String,
key: String,
rawFlag: ReadableMap?,
targetingKey: String,
attributes: ReadableMap,
errorCode: String?,
promise: Promise,
) {
_FlagsInternalProxy(getClient(clientName)).trackFlagEvaluationEvent(
key,
rawFlag?.let { convertMapToUnparsedFlag(it.toMap()) },
buildEvaluationContext(targetingKey, attributes),
errorCode,
)
promise.resolve(null)
}

/**
* Associate a flag evaluation with RUM without recording an exposure or evaluation event.
* @param clientName The name of the client.
* @param key The key of the flag.
* @param variant The evaluated flag variant.
* @param targetingKey The targeting key.
* @param attributes The attributes for the evaluation context.
* @param promise The promise to resolve after the native call, without waiting for upload.
*/
@Suppress("LongParameterList")
fun trackRumEvaluation(
clientName: String,
key: String,
variant: String,
targetingKey: String,
attributes: ReadableMap,
promise: Promise,
) {
_FlagsInternalProxy(getClient(clientName)).trackFlagRumEvaluation(
key,
variant,
buildEvaluationContext(targetingKey, attributes),
)
promise.resolve(null)
}

internal companion object {
internal const val NAME = "DdFlags"
}
Expand Down Expand Up @@ -166,6 +247,9 @@ private fun buildFlagsConfiguration(configuration: Map<String, Any?>): FlagsConf
(configuration["customExposureEndpoint"] as? String)?.let {
useCustomExposureEndpoint("$it/api/v2/exposures")
}
(configuration["customEvaluationEndpoint"] as? String)?.let {
useCustomEvaluationEndpoint("$it/api/v2/flagevaluation")
}
}.build()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,49 @@ class DdFlags(
) {
implementation.trackEvaluation(clientName, key, rawFlag, targetingKey, attributes, promise)
}

@ReactMethod
override fun trackRumEvaluation(
clientName: String,
key: String,
variant: String,
targetingKey: String,
attributes: ReadableMap,
promise: Promise,
) {
implementation.trackRumEvaluation(clientName, key, variant, targetingKey, attributes, promise)
}

@ReactMethod
override fun trackExposure(
clientName: String,
key: String,
rawFlag: ReadableMap,
targetingKey: String,
attributes: ReadableMap,
promise: Promise,
) {
implementation.trackExposure(clientName, key, rawFlag, targetingKey, attributes, promise)
}

@ReactMethod
override fun trackEvaluationEvent(
clientName: String,
key: String,
rawFlag: ReadableMap?,
targetingKey: String,
attributes: ReadableMap,
errorCode: String?,
promise: Promise,
) {
implementation.trackEvaluationEvent(
clientName,
key,
rawFlag,
targetingKey,
attributes,
errorCode,
promise,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,56 @@ class DdFlags(reactContext: ReactApplicationContext) : ReactContextBaseJavaModul
) {
implementation.trackEvaluation(clientName, key, rawFlag, targetingKey, attributes, promise)
}

@ReactMethod
fun trackRumEvaluation(
clientName: String,
key: String,
variant: String,
targetingKey: String,
attributes: ReadableMap,
promise: Promise
) {
implementation.trackRumEvaluation(
clientName,
key,
variant,
targetingKey,
attributes,
promise
)
}

@ReactMethod
fun trackExposure(
clientName: String,
key: String,
rawFlag: ReadableMap,
targetingKey: String,
attributes: ReadableMap,
promise: Promise
) {
implementation.trackExposure(clientName, key, rawFlag, targetingKey, attributes, promise)
}

@ReactMethod
fun trackEvaluationEvent(
clientName: String,
key: String,
rawFlag: ReadableMap?,
targetingKey: String,
attributes: ReadableMap,
errorCode: String?,
promise: Promise
) {
implementation.trackEvaluationEvent(
clientName,
key,
rawFlag,
targetingKey,
attributes,
errorCode,
promise
)
}
}
Loading
Loading