Skip to content

Commit

Permalink
Merge branch 'develop' into jward/RUMM-2729-add-error-architecture
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzybinary committed Nov 11, 2022
2 parents a426283 + 931b063 commit 106c418
Show file tree
Hide file tree
Showing 58 changed files with 2,178 additions and 318 deletions.
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
# 1.15.0 / 2022-11-09

* [FEATURE] RUM: Add frustration signal 'Error Tap'. See [#1006](https://github.com/DataDog/dd-sdk-android/pull/1006)
* [FEATURE] RUM: Report frustration count on views. See [#1030](https://github.com/DataDog/dd-sdk-android/pull/1030)
* [FEATURE] RUM: Add API to enable/disable tracking of frustration signals. See [#1085](https://github.com/DataDog/dd-sdk-android/pull/1085)
* [FEATURE] RUM: Create internal API for sending technical performance metrics. See [#1083](https://github.com/DataDog/dd-sdk-android/pull/1083)
* [FEATURE] RUM: Configuration Telemetry. See [#1118](https://github.com/DataDog/dd-sdk-android/pull/1118)
* [IMPROVEMENT] Internal: Add internal DNS resolver. See [#991](https://github.com/DataDog/dd-sdk-android/pull/991)
* [IMPROVEMENT] RUM: Support sending CPU architecture as part of device info. See [#1000](https://github.com/DataDog/dd-sdk-android/pull/1000)
* [IMPROVEMENT] Internal: Add checks on intake request headers. See [#1005](https://github.com/DataDog/dd-sdk-android/pull/1005)
* [IMPROVEMENT] RUM: Enable custom application version support. See [#1020](https://github.com/DataDog/dd-sdk-android/pull/1020)
* [IMPROVEMENT] RUM: Add configuration method to disable action tracking. See [#1023](https://github.com/DataDog/dd-sdk-android/pull/1023)
* [IMPROVEMENT] Global: Minor performance optimization during serialization into JSON format. See [#1066](https://github.com/DataDog/dd-sdk-android/pull/1066)
* [IMPROVEMENT] Global: Editable additional attributes. See [#1089](https://github.com/DataDog/dd-sdk-android/pull/1089)
* [IMPROVEMENT] RUM: Add tracing sampling attribute. See [#1092](https://github.com/DataDog/dd-sdk-android/pull/1092)
* [IMPROVEMENT] RUM: Invert frame time to get js refresh rate. See [#1105](https://github.com/DataDog/dd-sdk-android/pull/1105)
* [IMPROVEMENT] Global: Target Android 13. See [#1130](https://github.com/DataDog/dd-sdk-android/pull/1130)
* [BUGFIX] Internal: Fix buttons overlap in the sample app. See [#1004](https://github.com/DataDog/dd-sdk-android/pull/1004)
* [BUGFIX] Global: Prevent crash on peekBody. See [#1080](https://github.com/DataDog/dd-sdk-android/pull/1080)
* [BUGFIX] Shutdown Kronos clock only after executors. See [#1127](https://github.com/DataDog/dd-sdk-android/pull/1127)
* [DOCS] Android and Android TV Monitoring Formatting Edit. See [#966](https://github.com/DataDog/dd-sdk-android/pull/966)
* [DOCS] Update statement about default view tracking strategy in the docs. See [#1003](https://github.com/DataDog/dd-sdk-android/pull/1003)
* [DOCS] Android Monitoring Doc Edit. See [#1010](https://github.com/DataDog/dd-sdk-android/pull/1010)
* [DOCS] Adds Secondary Doc Reviewer. See [#1011](https://github.com/DataDog/dd-sdk-android/pull/1011)
* [DOCS] Replace references to iOS classes with correct Android equivalents. See [#1012](https://github.com/DataDog/dd-sdk-android/pull/1012)
* [DOCS] Add setVitalsUpdateFrequency to the doc. See [#1015](https://github.com/DataDog/dd-sdk-android/pull/1015)
* [DOCS] Android Integrated Libraries Update. See [#1021](https://github.com/DataDog/dd-sdk-android/pull/1021)
* [DOCS] Sync Doc Changes From Master to Develop. See [#1024](https://github.com/DataDog/dd-sdk-android/pull/1024)
* [MAINTENANCE] CI: Use a gitlab template for analysis generated files check. See [#1016](https://github.com/DataDog/dd-sdk-android/pull/1016)
* [MAINTENANCE] Update Cmake to 3.22.1. See [#1032](https://github.com/DataDog/dd-sdk-android/pull/1032)
* [MAINTENANCE] Update CODEOWNERS. See [#1045](https://github.com/DataDog/dd-sdk-android/pull/1045)
* [MAINTENANCE] Update AGP to 7.3.0. See [#1060](https://github.com/DataDog/dd-sdk-android/pull/1060)
* [MAINTENANCE] CI: Use KtLint 0.45.1 and dedicated runner image. See [#1081](https://github.com/DataDog/dd-sdk-android/pull/1081)
* [MAINTENANCE] CI: Migrate ktlint CI job to shared gitlab template. See [#1084](https://github.com/DataDog/dd-sdk-android/pull/1084)
* [MAINTENANCE] Update ktlint to 0.47.1. See [#1091](https://github.com/DataDog/dd-sdk-android/pull/1091)
* [MAINTENANCE] Publish SNAPSHOT builds to sonatype on pushes to develop. See [#1093](https://github.com/DataDog/dd-sdk-android/pull/1093)
* [MAINTENANCE] Add version to top level project for nexusPublishing extension. See [#1096](https://github.com/DataDog/dd-sdk-android/pull/1096)
* [MAINTENANCE] Fix import ordering. See [#1098](https://github.com/DataDog/dd-sdk-android/pull/1098)
* [MAINTENANCE] Deprecate DatadogPlugin class and its usage. See [#1100](https://github.com/DataDog/dd-sdk-android/pull/1100)
* [MAINTENANCE] CI: Update .gitlab-ci.yml to use release image for static-analysis job. See [#1102](https://github.com/DataDog/dd-sdk-android/pull/1102)
* [MAINTENANCE] Suppress DatadogPlugin deprecation for instrumented tests. See [#1114](https://github.com/DataDog/dd-sdk-android/pull/1114)
* [MAINTENANCE] Remove Flutter from Dogfooding scripts. See [#1120](https://github.com/DataDog/dd-sdk-android/pull/1120)
* [MAINTENANCE] Fix flaky ANR detection test. See [#1123](https://github.com/DataDog/dd-sdk-android/pull/1123)
* [MAINTENANCE] Android Gradle Plugin 7.3.1. See [#1124](https://github.com/DataDog/dd-sdk-android/pull/1124)
* [MAINTENANCE] Filter out telemetry in the assertions of instrumented RUM tests. See [#1131](https://github.com/DataDog/dd-sdk-android/pull/1131)

# 1.14.1 / 2022-09-27

* [IMPROVEMENT] Global: Add CPU architecture to the collected device information. See [#1000](https://github.com/DataDog/dd-sdk-android/pull/1000)
Expand Down
14 changes: 4 additions & 10 deletions Dockerfile.gitlab
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,11 @@ RUN set -x \
&& rm -rf /var/lib/apt/lists/*

ENV GRADLE_VERSION 7.5
ENV ANDROID_COMPILE_SDK 31
ENV ANDROID_BUILD_TOOLS 31.0.0
ENV ANDROID_SDK_TOOLS 7583922
ENV NDK_VERSION 22.1.7171670
ENV ANDROID_COMPILE_SDK 33
ENV ANDROID_BUILD_TOOLS 33.0.0
ENV ANDROID_SDK_TOOLS 8512546
ENV NDK_VERSION 25.1.8937393
ENV CMAKE_VERSION 3.22.1
# Docker image is shared between branches and some older versions (1.14 and below) need to have CMAKE 3.10
# Can be removed at some point
ENV CMAKE_VERSION_LEGACY 3.10.2.4988404



RUN apt update && apt install -y python3

Expand Down Expand Up @@ -73,7 +68,6 @@ RUN \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --install "ndk;${NDK_VERSION}" >/dev/null && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --install "cmake;${CMAKE_VERSION}" >/dev/null && \
echo y | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --install "cmake;${CMAKE_VERSION_LEGACY}" >/dev/null && \
yes | android-sdk-linux/cmdline-tools/latest/bin/sdkmanager --licenses

RUN set -x \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object Dependencies {
object Versions {

// NDK
const val Ndk = "22.1.7171670"
const val Ndk = "25.1.8937393"
const val CMake = "3.22.1"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import com.datadog.gradle.utils.Version

object AndroidConfig {

const val TARGET_SDK = 31
const val TARGET_SDK = 33
const val MIN_SDK = 19

// this is temporary, until we bump min sdk. Compose requires min sdk 21.
const val MIN_SDK_FOR_COMPOSE = 21
const val BUILD_TOOLS_VERSION = "31.0.0"
const val BUILD_TOOLS_VERSION = "33.0.0"

val VERSION = Version(1, 15, 0, Version.Type.Snapshot)
val VERSION = Version(1, 16, 0, Version.Type.Snapshot)
}

@Suppress("UnstableApiUsage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ data class JsonDefinition(
@SerializedName("items") val items: JsonDefinition?,
@SerializedName("allOf") val allOf: List<JsonDefinition>?,
@SerializedName("oneOf") val oneOf: List<JsonDefinition>?,
@SerializedName("anyOf") val anyOf: List<JsonDefinition>?,
@SerializedName("properties") val properties: Map<String, JsonDefinition>?,
@SerializedName("definitions") val definitions: Map<String, JsonDefinition>?,
@SerializedName("readOnly") val readOnly: Boolean?,
Expand All @@ -42,6 +43,7 @@ data class JsonDefinition(
items = null,
allOf = null,
oneOf = null,
anyOf = null,
properties = null,
definitions = null,
readOnly = null,
Expand All @@ -62,6 +64,7 @@ data class JsonDefinition(
items = null,
allOf = null,
oneOf = null,
anyOf = null,
properties = null,
definitions = null,
readOnly = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ class JsonSchemaReader(
generateTypeAllOf(typeName, definition.allOf, fromFile)
} else if (!definition.oneOf.isNullOrEmpty()) {
generateTypeOneOf(typeName, definition.oneOf, definition.description, fromFile)
} else if (!definition.anyOf.isNullOrEmpty()) {
// for now let's consider anyOf to be equivalent to oneOf
generateTypeOneOf(typeName, definition.anyOf, definition.description, fromFile)
} else if (!definition.ref.isNullOrBlank()) {
val refDefinition = findDefinitionReference(definition.ref, fromFile)
if (refDefinition != null) {
Expand Down Expand Up @@ -304,9 +307,10 @@ class JsonSchemaReader(
TypeDefinition.Null(description.orEmpty())
} else if (options.size == 1) {
options.first()
} else if (asArray != null && options.all { it == asArray || it == asArray.items }) {
// we're in a case with `oneOf(<T>, Array<T>)`
} else if (asArray != null) {
// we're (probably) in a case with `oneOf(<T>, Array<T>)`
// because we can't make a type matching both, we simplify it to be always an array
logger.warn("Simplifying a 'oneOf' constraint to $asArray")
asArray
} else if (options.all { it is TypeDefinition.Class }) {
TypeDefinition.OneOfClass(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,17 @@ enum class JsonType {
STRING,

@SerializedName("integer")
INTEGER
INTEGER;

fun asJsonPrimitiveType(): JsonPrimitiveType? {
return when (this) {
BOOLEAN -> JsonPrimitiveType.BOOLEAN
NUMBER -> JsonPrimitiveType.NUMBER
STRING -> JsonPrimitiveType.STRING
INTEGER -> JsonPrimitiveType.INTEGER
ARRAY,
OBJECT,
NULL -> null
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ internal class ComposeNavigationObserver(
val attributes = mutableMapOf<String, Any?>()

bundle.keySet().forEach {
// TODO RUMM-2717 Bundle#get is deprecated, but there is no replacement for it.
// Issue is opened in the Google Issue Tracker.
@Suppress("DEPRECATION")
attributes["$ARGUMENT_TAG.$it"] = bundle.get(it)
}

Expand Down
30 changes: 13 additions & 17 deletions dd-sdk-android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,21 @@ in Datadog. **Make sure you create a key of type `Client Token`.**

```kotlin
class SampleApplication : Application() {

override fun onCreate() {
super.onCreate()
Datadog.initialize(this, BuildConfig.DD_CLIENT_TOKEN)
}
}
```

### Setup for Europe

If you're targeting our [Europe servers](https://datadoghq.eu), you can
initialize the library like this:

```kotlin
class SampleApplication : Application() {

override fun onCreate() {
super.onCreate()
Datadog.initialize(this, BuildConfig.DD_CLIENT_TOKEN, Datadog.DATADOG_EU)
val configuration = Configuration.Builder(
logsEnabled = true,
tracesEnabled = true,
crashReportsEnabled = true,
rumEnabled = true
)
.useSite(DatadogSite.US1) // replace with the site you're targetting (e.g.: US3, EU1, …)
.trackInteractions()
.trackLongTasks(durationThreshold)
.useViewTrackingStrategy(strategy)
.build()
val credentials = Credentials(CLIENT_TOKEN, ENV_NAME, APP_VARIANT_NAME, APPLICATION_ID)
Datadog.initialize(this, credentials, configuration, trackingConsent)
}
}
```
Expand Down
66 changes: 64 additions & 2 deletions dd-sdk-android/apiSurface
Original file line number Diff line number Diff line change
Expand Up @@ -1574,8 +1574,68 @@ class com.datadog.android.sqlite.DatadogDatabaseErrorHandler : android.database.
constructor(android.database.DatabaseErrorHandler = DefaultDatabaseErrorHandler())
override fun onCorruption(android.database.sqlite.SQLiteDatabase)
companion object
data class com.datadog.android.telemetry.model.TelemetryConfigurationEvent
constructor(Dd, kotlin.Long, kotlin.String, Source, kotlin.String, Application? = null, Session? = null, View? = null, Action? = null, kotlin.collections.List<kotlin.String>? = null, Telemetry)
val type: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): TelemetryConfigurationEvent
class Dd
constructor()
val formatVersion: kotlin.Long
fun toJson(): com.google.gson.JsonElement
data class Application
constructor(kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Application
data class Session
constructor(kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Session
data class View
constructor(kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): View
data class Action
constructor(kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Action
data class Telemetry
constructor(Configuration)
val type: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Telemetry
data class Configuration
constructor(kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Long? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.String? = null, kotlin.Boolean? = null, kotlin.String? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.collections.List<kotlin.String>? = null, kotlin.collections.List<kotlin.String>? = null, kotlin.Boolean? = null, ViewTrackingStrategy? = null, kotlin.Boolean? = null, kotlin.Long? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.Boolean? = null, kotlin.String? = null, kotlin.Boolean? = null, kotlin.Long? = null, kotlin.Long? = null)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Configuration
enum Source
constructor(kotlin.String)
- ANDROID
- IOS
- BROWSER
- FLUTTER
- REACT_NATIVE
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Source
enum ViewTrackingStrategy
constructor(kotlin.String)
- ACTIVITYVIEWTRACKINGSTRATEGY
- FRAGMENTVIEWTRACKINGSTRATEGY
- MIXEDVIEWTRACKINGSTRATEGY
- NAVIGATIONVIEWTRACKINGSTRATEGY
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): ViewTrackingStrategy
data class com.datadog.android.telemetry.model.TelemetryDebugEvent
constructor(Dd, kotlin.Long, kotlin.String, Source, kotlin.String, Application? = null, Session? = null, View? = null, Action? = null, Telemetry)
constructor(Dd, kotlin.Long, kotlin.String, Source, kotlin.String, Application? = null, Session? = null, View? = null, Action? = null, kotlin.collections.List<kotlin.String>? = null, Telemetry)
val type: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
Expand Down Expand Up @@ -1606,6 +1666,7 @@ data class com.datadog.android.telemetry.model.TelemetryDebugEvent
fun fromJson(kotlin.String): Action
data class Telemetry
constructor(kotlin.String)
val type: kotlin.String
val status: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
Expand All @@ -1621,7 +1682,7 @@ data class com.datadog.android.telemetry.model.TelemetryDebugEvent
companion object
fun fromJson(kotlin.String): Source
data class com.datadog.android.telemetry.model.TelemetryErrorEvent
constructor(Dd, kotlin.Long, kotlin.String, Source, kotlin.String, Application? = null, Session? = null, View? = null, Action? = null, Telemetry)
constructor(Dd, kotlin.Long, kotlin.String, Source, kotlin.String, Application? = null, Session? = null, View? = null, Action? = null, kotlin.collections.List<kotlin.String>? = null, Telemetry)
val type: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
Expand Down Expand Up @@ -1652,6 +1713,7 @@ data class com.datadog.android.telemetry.model.TelemetryErrorEvent
fun fromJson(kotlin.String): Action
data class Telemetry
constructor(kotlin.String, Error? = null)
val type: kotlin.String
val status: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
Expand Down
10 changes: 9 additions & 1 deletion dd-sdk-android/src/main/json/telemetry/_common-schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "_common-schema.json",
"$id": "telemetry/_common-schema.json",
"title": "CommonTelemetryProperties",
"type": "object",
"description": "Schema of common properties of Telemetry events",
Expand Down Expand Up @@ -92,6 +92,14 @@
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
}
}
},
"experimental_features": {
"type": "array",
"description": "Enabled experimental features",
"items": {
"type": "string"
},
"readOnly": true
}
}
}
Loading

0 comments on commit 106c418

Please sign in to comment.