Skip to content

Commit

Permalink
Merge pull request #945 from DataDog/nogorodnikov/rumm-2196/add-os-an…
Browse files Browse the repository at this point in the history
…d-device-information-to-rum-events

RUMM-2196: Add OS and device information to RUM events
  • Loading branch information
0xnm authored Jun 15, 2022
2 parents 3638d6b + 9f681b7 commit 3b1c057
Show file tree
Hide file tree
Showing 49 changed files with 3,302 additions and 196 deletions.
132 changes: 121 additions & 11 deletions dd-sdk-android/apiSurface
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ enum com.datadog.android.rum.RumResourceKind
interface com.datadog.android.rum.RumSessionListener
fun onSessionStarted(String, Boolean)
data class com.datadog.android.rum.model.ActionEvent
constructor(kotlin.Long, Application, kotlin.String? = null, ActionEventSession, Source? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Dd, Context? = null, Action)
constructor(kotlin.Long, Application, kotlin.String? = null, ActionEventSession, Source? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Os? = null, Device? = null, Dd, Context? = null, Action)
val type: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
Expand Down Expand Up @@ -445,6 +445,16 @@ data class com.datadog.android.rum.model.ActionEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): CiTest
data class Os
constructor(kotlin.String, kotlin.String, kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Os
data class Device
constructor(DeviceType, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Device
data class Dd
constructor(DdSession? = null, kotlin.String? = null)
val formatVersion: kotlin.Long
Expand Down Expand Up @@ -536,6 +546,18 @@ data class com.datadog.android.rum.model.ActionEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Interface
enum DeviceType
constructor(kotlin.String)
- MOBILE
- DESKTOP
- TABLET
- TV
- GAMING_CONSOLE
- BOT
- OTHER
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): DeviceType
enum ActionType
constructor(kotlin.String)
- CUSTOM
Expand All @@ -556,7 +578,7 @@ data class com.datadog.android.rum.model.ActionEvent
companion object
fun fromJson(kotlin.String): Plan
data class com.datadog.android.rum.model.ErrorEvent
constructor(kotlin.Long, Application, kotlin.String? = null, ErrorEventSession, ErrorEventSource? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Dd, Context? = null, Error, Action? = null)
constructor(kotlin.Long, Application, kotlin.String? = null, ErrorEventSession, ErrorEventSource? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Os? = null, Device? = null, Dd, Context? = null, Error, Action? = null)
val type: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
Expand Down Expand Up @@ -596,6 +618,16 @@ data class com.datadog.android.rum.model.ErrorEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): CiTest
data class Os
constructor(kotlin.String, kotlin.String, kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Os
data class Device
constructor(DeviceType, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Device
data class Dd
constructor(DdSession? = null, kotlin.String? = null)
val formatVersion: kotlin.Long
Expand Down Expand Up @@ -677,6 +709,18 @@ data class com.datadog.android.rum.model.ErrorEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Interface
enum DeviceType
constructor(kotlin.String)
- MOBILE
- DESKTOP
- TABLET
- TV
- GAMING_CONSOLE
- BOT
- OTHER
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): DeviceType
enum ErrorSource
constructor(kotlin.String)
- NETWORK
Expand Down Expand Up @@ -745,7 +789,7 @@ data class com.datadog.android.rum.model.ErrorEvent
companion object
fun fromJson(kotlin.String): ProviderType
data class com.datadog.android.rum.model.LongTaskEvent
constructor(kotlin.Long, Application, kotlin.String? = null, LongTaskEventSession, Source? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Dd, Context? = null, LongTask, Action? = null)
constructor(kotlin.Long, Application, kotlin.String? = null, LongTaskEventSession, Source? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Os? = null, Device? = null, Dd, Context? = null, LongTask, Action? = null)
val type: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
Expand All @@ -756,7 +800,7 @@ data class com.datadog.android.rum.model.LongTaskEvent
companion object
fun fromJson(kotlin.String): Application
data class LongTaskEventSession
constructor(kotlin.String, Type, kotlin.Boolean? = null)
constructor(kotlin.String, LongTaskEventSessionType, kotlin.Boolean? = null)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): LongTaskEventSession
Expand Down Expand Up @@ -785,6 +829,16 @@ data class com.datadog.android.rum.model.LongTaskEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): CiTest
data class Os
constructor(kotlin.String, kotlin.String, kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Os
data class Device
constructor(DeviceType, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Device
data class Dd
constructor(DdSession? = null, kotlin.String? = null)
val formatVersion: kotlin.Long
Expand Down Expand Up @@ -826,14 +880,14 @@ data class com.datadog.android.rum.model.LongTaskEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Source
enum Type
enum LongTaskEventSessionType
constructor(kotlin.String)
- USER
- SYNTHETICS
- CI_TEST
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Type
fun fromJson(kotlin.String): LongTaskEventSessionType
enum Status
constructor(kotlin.String)
- CONNECTED
Expand All @@ -856,6 +910,18 @@ data class com.datadog.android.rum.model.LongTaskEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Interface
enum DeviceType
constructor(kotlin.String)
- MOBILE
- DESKTOP
- TABLET
- TV
- GAMING_CONSOLE
- BOT
- OTHER
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): DeviceType
enum Plan
constructor(kotlin.Number)
- PLAN_1
Expand All @@ -864,7 +930,7 @@ data class com.datadog.android.rum.model.LongTaskEvent
companion object
fun fromJson(kotlin.String): Plan
data class com.datadog.android.rum.model.ResourceEvent
constructor(kotlin.Long, Application, kotlin.String? = null, ResourceEventSession, Source? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Dd, Context? = null, Resource, Action? = null)
constructor(kotlin.Long, Application, kotlin.String? = null, ResourceEventSession, Source? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Os? = null, Device? = null, Dd, Context? = null, Resource, Action? = null)
val type: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
Expand Down Expand Up @@ -904,6 +970,16 @@ data class com.datadog.android.rum.model.ResourceEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): CiTest
data class Os
constructor(kotlin.String, kotlin.String, kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Os
data class Device
constructor(DeviceType, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Device
data class Dd
constructor(DdSession? = null, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null)
val formatVersion: kotlin.Long
Expand Down Expand Up @@ -1010,6 +1086,18 @@ data class com.datadog.android.rum.model.ResourceEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Interface
enum DeviceType
constructor(kotlin.String)
- MOBILE
- DESKTOP
- TABLET
- TV
- GAMING_CONSOLE
- BOT
- OTHER
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): DeviceType
enum ResourceType
constructor(kotlin.String)
- DOCUMENT
Expand Down Expand Up @@ -1064,7 +1152,7 @@ data class com.datadog.android.rum.model.ResourceEvent
companion object
fun fromJson(kotlin.String): ProviderType
data class com.datadog.android.rum.model.ViewEvent
constructor(kotlin.Long, Application, kotlin.String? = null, ViewEventSession, Source? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Dd, Context? = null)
constructor(kotlin.Long, Application, kotlin.String? = null, ViewEventSession, Source? = null, View, Usr? = null, Connectivity? = null, Synthetics? = null, CiTest? = null, Os? = null, Device? = null, Dd, Context? = null)
val type: kotlin.String
fun toJson(): com.google.gson.JsonElement
companion object
Expand All @@ -1075,7 +1163,7 @@ data class com.datadog.android.rum.model.ViewEvent
companion object
fun fromJson(kotlin.String): Application
data class ViewEventSession
constructor(kotlin.String, Type, kotlin.Boolean? = null)
constructor(kotlin.String, ViewEventSessionType, kotlin.Boolean? = null)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): ViewEventSession
Expand Down Expand Up @@ -1104,6 +1192,16 @@ data class com.datadog.android.rum.model.ViewEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): CiTest
data class Os
constructor(kotlin.String, kotlin.String, kotlin.String)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Os
data class Device
constructor(DeviceType, kotlin.String? = null, kotlin.String? = null, kotlin.String? = null)
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Device
data class Dd
constructor(DdSession? = null, kotlin.String? = null, kotlin.Long)
val formatVersion: kotlin.Long
Expand Down Expand Up @@ -1175,14 +1273,14 @@ data class com.datadog.android.rum.model.ViewEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Source
enum Type
enum ViewEventSessionType
constructor(kotlin.String)
- USER
- SYNTHETICS
- CI_TEST
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Type
fun fromJson(kotlin.String): ViewEventSessionType
enum LoadingType
constructor(kotlin.String)
- INITIAL_LOAD
Expand Down Expand Up @@ -1218,6 +1316,18 @@ data class com.datadog.android.rum.model.ViewEvent
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): Interface
enum DeviceType
constructor(kotlin.String)
- MOBILE
- DESKTOP
- TABLET
- TV
- GAMING_CONSOLE
- BOT
- OTHER
fun toJson(): com.google.gson.JsonElement
companion object
fun fromJson(kotlin.String): DeviceType
enum Plan
constructor(kotlin.Number)
- PLAN_1
Expand Down
64 changes: 64 additions & 0 deletions dd-sdk-android/src/main/json/rum/_common-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,70 @@
},
"readOnly": true
},
"os": {
"type": "object",
"description": "Operating system properties",
"required": [
"name",
"version",
"version_major"
],
"properties": {
"name": {
"type": "string",
"description": "Operating system name, e.g. Android, iOS",
"readOnly": true
},
"version": {
"type": "string",
"description": "Full operating system version, e.g. 8.1.1",
"readOnly": true
},
"version_major": {
"type": "string",
"description": "Major operating system version, e.g. 8",
"readOnly": true
}
}
},
"device": {
"type": "object",
"description": "Device properties",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"description": "Device type info",
"enum": [
"mobile",
"desktop",
"tablet",
"tv",
"gaming_console",
"bot",
"other"
],
"readOnly": true
},
"name": {
"type": "string",
"description": "Device marketing name, e.g. Xiaomi Redmi Note 8 Pro, Pixel 5, etc.",
"readOnly": true
},
"model": {
"type": "string",
"description": "Device SKU model, e.g. Samsung SM-988GN, etc. Quite often name and model can be the same.",
"readOnly": true
},
"brand": {
"type": "string",
"description": "Device marketing brand, e.g. Apple, OPPO, Xiaomi, etc.",
"readOnly": true
}
}
},
"_dd": {
"type": "object",
"description": "Internal properties",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ import com.datadog.android.core.internal.persistence.file.batch.BatchFileHandler
import com.datadog.android.core.internal.privacy.ConsentProvider
import com.datadog.android.core.internal.privacy.NoOpConsentProvider
import com.datadog.android.core.internal.privacy.TrackingConsentProvider
import com.datadog.android.core.internal.system.AndroidInfoProvider
import com.datadog.android.core.internal.system.BroadcastReceiverSystemInfoProvider
import com.datadog.android.core.internal.system.DefaultAndroidInfoProvider
import com.datadog.android.core.internal.system.NoOpAndroidInfoProvider
import com.datadog.android.core.internal.system.NoOpSystemInfoProvider
import com.datadog.android.core.internal.system.SystemInfoProvider
import com.datadog.android.core.internal.time.KronosTimeProvider
Expand Down Expand Up @@ -148,6 +151,7 @@ internal object CoreFeature {
internal lateinit var persistenceExecutorService: ExecutorService
internal var localDataEncryption: Encryption? = null
internal lateinit var webViewTrackingHosts: List<String>
internal lateinit var androidInfoProvider: AndroidInfoProvider

// TESTS ONLY, to prevent Kronos spinning sync threads in unit-tests
internal var disableKronosBackgroundSync = false
Expand All @@ -168,6 +172,7 @@ internal object CoreFeature {
setupOkHttpClient(configuration)
firstPartyHostDetector.addKnownHosts(configuration.firstPartyHosts)
webViewTrackingHosts = configuration.webViewTrackingHosts
androidInfoProvider = DefaultAndroidInfoProvider(appContext)
setupExecutors()
// Time Provider
timeProvider = KronosTimeProvider(kronosClock)
Expand Down Expand Up @@ -261,7 +266,8 @@ internal object CoreFeature {
UserInfoDeserializer(sdkLogger),
sdkLogger,
timeProvider,
BatchFileHandler.create(sdkLogger, localDataEncryption)
BatchFileHandler.create(sdkLogger, localDataEncryption),
androidInfoProvider = androidInfoProvider
)
ndkCrashHandler.prepareData()
}
Expand Down Expand Up @@ -462,6 +468,7 @@ internal object CoreFeature {
timeProvider = NoOpTimeProvider()
trackingConsentProvider = NoOpConsentProvider()
userInfoProvider = NoOpMutableUserInfoProvider()
androidInfoProvider = NoOpAndroidInfoProvider()
}

// endregion
Expand Down
Loading

0 comments on commit 3b1c057

Please sign in to comment.