Skip to content

Commit

Permalink
Update RUM Schema
Browse files Browse the repository at this point in the history
Adds support for flutter error source (RUMM-1900)
  • Loading branch information
fuzzybinary committed Jan 11, 2022
1 parent 79c63be commit aa0bdc5
Show file tree
Hide file tree
Showing 2 changed files with 261 additions and 2 deletions.
118 changes: 117 additions & 1 deletion Sources/Datadog/RUM/DataModels/RUMDataModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ public struct RUMViewEvent: RUMDataModel {
/// Application properties
public let application: Application

/// CI Visibility properties
public let ciTest: CiTest?

/// Device connectivity properties
public let connectivity: RUMConnectivity?

Expand Down Expand Up @@ -46,6 +49,7 @@ public struct RUMViewEvent: RUMDataModel {
enum CodingKeys: String, CodingKey {
case dd = "_dd"
case application = "application"
case ciTest = "ci_test"
case connectivity = "connectivity"
case context = "context"
case date = "date"
Expand All @@ -59,6 +63,9 @@ public struct RUMViewEvent: RUMDataModel {

/// Internal properties
public struct DD: Codable {
/// Browser SDK version
public let browserSdkVersion: String?

/// Version of the update of the view event
public let documentVersion: Int64

Expand All @@ -69,6 +76,7 @@ public struct RUMViewEvent: RUMDataModel {
public let session: Session?

enum CodingKeys: String, CodingKey {
case browserSdkVersion = "browser_sdk_version"
case documentVersion = "document_version"
case formatVersion = "format_version"
case session = "session"
Expand Down Expand Up @@ -101,6 +109,16 @@ public struct RUMViewEvent: RUMDataModel {
}
}

/// CI Visibility properties
public struct CiTest: Codable {
/// The identifier of the current CI Visibility test execution
public let testExecutionId: String

enum CodingKeys: String, CodingKey {
case testExecutionId = "test_execution_id"
}
}

/// Session properties
public struct Session: Codable {
/// Whether this session has a replay
Expand All @@ -122,18 +140,23 @@ public struct RUMViewEvent: RUMDataModel {
public enum SessionType: String, Codable {
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
}
}

/// Synthetics properties
public struct Synthetics: Codable {
/// Whether the event comes from a SDK instance injected by Synthetics
public let injected: Bool?

/// The identifier of the current Synthetics test results
public let resultId: String

/// The identifier of the current Synthetics test
public let testId: String

enum CodingKeys: String, CodingKey {
case injected = "injected"
case resultId = "result_id"
case testId = "test_id"
}
Expand Down Expand Up @@ -371,6 +394,9 @@ public struct RUMResourceEvent: RUMDataModel {
/// Application properties
public let application: Application

/// CI Visibility properties
public let ciTest: CiTest?

/// Device connectivity properties
public let connectivity: RUMConnectivity?

Expand Down Expand Up @@ -405,6 +431,7 @@ public struct RUMResourceEvent: RUMDataModel {
case dd = "_dd"
case action = "action"
case application = "application"
case ciTest = "ci_test"
case connectivity = "connectivity"
case context = "context"
case date = "date"
Expand All @@ -419,6 +446,9 @@ public struct RUMResourceEvent: RUMDataModel {

/// Internal properties
public struct DD: Codable {
/// Browser SDK version
public let browserSdkVersion: String?

/// Version of the RUM event format
public let formatVersion: Int64 = 2

Expand All @@ -432,6 +462,7 @@ public struct RUMResourceEvent: RUMDataModel {
public let traceId: String?

enum CodingKeys: String, CodingKey {
case browserSdkVersion = "browser_sdk_version"
case formatVersion = "format_version"
case session = "session"
case spanId = "span_id"
Expand Down Expand Up @@ -475,6 +506,16 @@ public struct RUMResourceEvent: RUMDataModel {
}
}

/// CI Visibility properties
public struct CiTest: Codable {
/// The identifier of the current CI Visibility test execution
public let testExecutionId: String

enum CodingKeys: String, CodingKey {
case testExecutionId = "test_execution_id"
}
}

/// Resource properties
public struct Resource: Codable {
/// Connect phase properties
Expand Down Expand Up @@ -693,18 +734,23 @@ public struct RUMResourceEvent: RUMDataModel {
public enum SessionType: String, Codable {
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
}
}

/// Synthetics properties
public struct Synthetics: Codable {
/// Whether the event comes from a SDK instance injected by Synthetics
public let injected: Bool?

/// The identifier of the current Synthetics test results
public let resultId: String

/// The identifier of the current Synthetics test
public let testId: String

enum CodingKeys: String, CodingKey {
case injected = "injected"
case resultId = "result_id"
case testId = "test_id"
}
Expand Down Expand Up @@ -744,6 +790,9 @@ public struct RUMActionEvent: RUMDataModel {
/// Application properties
public let application: Application

/// CI Visibility properties
public let ciTest: CiTest?

/// Device connectivity properties
public let connectivity: RUMConnectivity?

Expand Down Expand Up @@ -775,6 +824,7 @@ public struct RUMActionEvent: RUMDataModel {
case dd = "_dd"
case action = "action"
case application = "application"
case ciTest = "ci_test"
case connectivity = "connectivity"
case context = "context"
case date = "date"
Expand All @@ -788,13 +838,17 @@ public struct RUMActionEvent: RUMDataModel {

/// Internal properties
public struct DD: Codable {
/// Browser SDK version
public let browserSdkVersion: String?

/// Version of the RUM event format
public let formatVersion: Int64 = 2

/// Session-related internal properties
public let session: Session?

enum CodingKeys: String, CodingKey {
case browserSdkVersion = "browser_sdk_version"
case formatVersion = "format_version"
case session = "session"
}
Expand Down Expand Up @@ -925,6 +979,16 @@ public struct RUMActionEvent: RUMDataModel {
}
}

/// CI Visibility properties
public struct CiTest: Codable {
/// The identifier of the current CI Visibility test execution
public let testExecutionId: String

enum CodingKeys: String, CodingKey {
case testExecutionId = "test_execution_id"
}
}

/// Session properties
public struct Session: Codable {
/// Whether this session has a replay
Expand All @@ -946,18 +1010,23 @@ public struct RUMActionEvent: RUMDataModel {
public enum SessionType: String, Codable {
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
}
}

/// Synthetics properties
public struct Synthetics: Codable {
/// Whether the event comes from a SDK instance injected by Synthetics
public let injected: Bool?

/// The identifier of the current Synthetics test results
public let resultId: String

/// The identifier of the current Synthetics test
public let testId: String

enum CodingKeys: String, CodingKey {
case injected = "injected"
case resultId = "result_id"
case testId = "test_id"
}
Expand Down Expand Up @@ -1001,6 +1070,9 @@ public struct RUMErrorEvent: RUMDataModel {
/// Application properties
public let application: Application

/// CI Visibility properties
public let ciTest: CiTest?

/// Device connectivity properties
public let connectivity: RUMConnectivity?

Expand Down Expand Up @@ -1035,6 +1107,7 @@ public struct RUMErrorEvent: RUMDataModel {
case dd = "_dd"
case action = "action"
case application = "application"
case ciTest = "ci_test"
case connectivity = "connectivity"
case context = "context"
case date = "date"
Expand All @@ -1049,13 +1122,17 @@ public struct RUMErrorEvent: RUMDataModel {

/// Internal properties
public struct DD: Codable {
/// Browser SDK version
public let browserSdkVersion: String?

/// Version of the RUM event format
public let formatVersion: Int64 = 2

/// Session-related internal properties
public let session: Session?

enum CodingKeys: String, CodingKey {
case browserSdkVersion = "browser_sdk_version"
case formatVersion = "format_version"
case session = "session"
}
Expand Down Expand Up @@ -1097,6 +1174,16 @@ public struct RUMErrorEvent: RUMDataModel {
}
}

/// CI Visibility properties
public struct CiTest: Codable {
/// The identifier of the current CI Visibility test execution
public let testExecutionId: String

enum CodingKeys: String, CodingKey {
case testExecutionId = "test_execution_id"
}
}

/// Error properties
public struct Error: Codable {
/// Whether the error has been handled manually in the source code or not
Expand Down Expand Up @@ -1223,6 +1310,7 @@ public struct RUMErrorEvent: RUMDataModel {
case browser = "browser"
case ios = "ios"
case reactNative = "react-native"
case flutter = "flutter"
}
}

Expand All @@ -1247,18 +1335,23 @@ public struct RUMErrorEvent: RUMDataModel {
public enum SessionType: String, Codable {
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
}
}

/// Synthetics properties
public struct Synthetics: Codable {
/// Whether the event comes from a SDK instance injected by Synthetics
public let injected: Bool?

/// The identifier of the current Synthetics test results
public let resultId: String

/// The identifier of the current Synthetics test
public let testId: String

enum CodingKeys: String, CodingKey {
case injected = "injected"
case resultId = "result_id"
case testId = "test_id"
}
Expand Down Expand Up @@ -1302,6 +1395,9 @@ public struct RUMLongTaskEvent: RUMDataModel {
/// Application properties
public let application: Application

/// CI Visibility properties
public let ciTest: CiTest?

/// Device connectivity properties
public let connectivity: RUMConnectivity?

Expand Down Expand Up @@ -1336,6 +1432,7 @@ public struct RUMLongTaskEvent: RUMDataModel {
case dd = "_dd"
case action = "action"
case application = "application"
case ciTest = "ci_test"
case connectivity = "connectivity"
case context = "context"
case date = "date"
Expand All @@ -1350,13 +1447,17 @@ public struct RUMLongTaskEvent: RUMDataModel {

/// Internal properties
public struct DD: Codable {
/// Browser SDK version
public let browserSdkVersion: String?

/// Version of the RUM event format
public let formatVersion: Int64 = 2

/// Session-related internal properties
public let session: Session?

enum CodingKeys: String, CodingKey {
case browserSdkVersion = "browser_sdk_version"
case formatVersion = "format_version"
case session = "session"
}
Expand Down Expand Up @@ -1398,6 +1499,16 @@ public struct RUMLongTaskEvent: RUMDataModel {
}
}

/// CI Visibility properties
public struct CiTest: Codable {
/// The identifier of the current CI Visibility test execution
public let testExecutionId: String

enum CodingKeys: String, CodingKey {
case testExecutionId = "test_execution_id"
}
}

/// Long Task properties
public struct LongTask: Codable {
/// Duration in ns of the long task
Expand Down Expand Up @@ -1437,18 +1548,23 @@ public struct RUMLongTaskEvent: RUMDataModel {
public enum SessionType: String, Codable {
case user = "user"
case synthetics = "synthetics"
case ciTest = "ci_test"
}
}

/// Synthetics properties
public struct Synthetics: Codable {
/// Whether the event comes from a SDK instance injected by Synthetics
public let injected: Bool?

/// The identifier of the current Synthetics test results
public let resultId: String

/// The identifier of the current Synthetics test
public let testId: String

enum CodingKeys: String, CodingKey {
case injected = "injected"
case resultId = "result_id"
case testId = "test_id"
}
Expand Down Expand Up @@ -1640,4 +1756,4 @@ public enum RUMMethod: String, Codable {
case patch = "PATCH"
}

// Generated from https://github.com/DataDog/rum-events-format/tree/9c135e77bb1da61ebbb6b2fb3b39e156d5120a8e
// Generated from https://github.com/DataDog/rum-events-format/tree/a7adc4275073e4d5bc146e9fdd4ceb4147379327
Loading

0 comments on commit aa0bdc5

Please sign in to comment.