Skip to content

Commit

Permalink
Merge pull request #1041 from DataDog/release/1.13.0
Browse files Browse the repository at this point in the history
Release 1.13.0
  • Loading branch information
maxep authored Nov 8, 2022
2 parents d2230ac + 53d6322 commit 10a027a
Show file tree
Hide file tree
Showing 67 changed files with 2,224 additions and 415 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

## Docs

/docs/ @DataDog/documentation @DataDog/rum-mobile @alai97
*README.md @DataDog/documentation @DataDog/rum-mobile @alai97
/docs/ @DataDog/documentation @DataDog/rum-mobile
*README.md @DataDog/documentation @DataDog/rum-mobile
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Unreleased

# 1.13.0 / 08-11-2022

- [IMPROVEMENT] Improve console logs when using `DDNoopRUMMonitor`. See [#1007][] (Thanks [@dfed][])
- [IMPROVEMENT] Add public API to control tracking of frustrations signals. See [#1013][]
- [IMPROVEMENT] Send trace sample rate (`dd.rulePsr`) for APM's traffic ingestion control page. See [#1029][]
- [IMPROVEMENT] Add a method to add user info properties. See [#1031][]
- [BUGFIX] Fix vitals default presets. See [#1043][]

# 1.12.1 / 18-10-2022

- [IMPROVEMENT] Upgrade to PLCrashReporter 1.11.0 to fix Xcode 14 support.
Expand Down Expand Up @@ -396,6 +404,11 @@
[#964]: https://github.com/DataDog/dd-sdk-ios/issues/964
[#973]: https://github.com/DataDog/dd-sdk-ios/issues/973
[#997]: https://github.com/DataDog/dd-sdk-ios/issues/997
[#1007]: https://github.com/DataDog/dd-sdk-ios/issues/1007
[#1013]: https://github.com/DataDog/dd-sdk-ios/issues/1013
[#1029]: https://github.com/DataDog/dd-sdk-ios/issues/1029
[#1031]: https://github.com/DataDog/dd-sdk-ios/issues/1031
[#1043]: https://github.com/DataDog/dd-sdk-ios/issues/1043
[@00fa9a]: https://github.com/00FA9A
[@britton-earnin]: https://github.com/Britton-Earnin
[@hengyu]: https://github.com/Hengyu
Expand All @@ -421,3 +434,4 @@
[@safa-ads]: https://github.com/safa-ads
[@sdejesusf]: https://github.com/sdejesusF
[@avdlee]: https://github.com/AvdLee
[@dfed]: https://github.com/dfed
6 changes: 6 additions & 0 deletions Datadog/Datadog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,8 @@
E132727B24B333C700952F8B /* TracingBenchmarkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E132727A24B333C700952F8B /* TracingBenchmarkTests.swift */; };
E132727D24B35B5F00952F8B /* TracingStorageBenchmarkTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E132727C24B35B5F00952F8B /* TracingStorageBenchmarkTests.swift */; };
E143CCAF27D236F600F4018A /* CITestIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E143CCAE27D236F600F4018A /* CITestIntegrationTests.swift */; };
E179FB4E28F80A6400CC2698 /* PerformanceMetric.swift in Sources */ = {isa = PBXBuildFile; fileRef = E179FB4D28F80A6400CC2698 /* PerformanceMetric.swift */; };
E179FB4F28F80A6400CC2698 /* PerformanceMetric.swift in Sources */ = {isa = PBXBuildFile; fileRef = E179FB4D28F80A6400CC2698 /* PerformanceMetric.swift */; };
E1D202EA24C065CF00D1AF3A /* ActiveSpansPool.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D202E924C065CF00D1AF3A /* ActiveSpansPool.swift */; };
E1D203FD24C1885C00D1AF3A /* ActiveSpansPoolTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D203FB24C1884500D1AF3A /* ActiveSpansPoolTests.swift */; };
E1D5AEA724B4D45B007F194B /* Versioning.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D5AEA624B4D45A007F194B /* Versioning.swift */; };
Expand Down Expand Up @@ -1844,6 +1846,7 @@
E132727A24B333C700952F8B /* TracingBenchmarkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TracingBenchmarkTests.swift; sourceTree = "<group>"; };
E132727C24B35B5F00952F8B /* TracingStorageBenchmarkTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TracingStorageBenchmarkTests.swift; sourceTree = "<group>"; };
E143CCAE27D236F600F4018A /* CITestIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CITestIntegrationTests.swift; sourceTree = "<group>"; };
E179FB4D28F80A6400CC2698 /* PerformanceMetric.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PerformanceMetric.swift; sourceTree = "<group>"; };
E1B082CB25641DF9002DB9D2 /* Example.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Example.xcconfig; sourceTree = "<group>"; };
E1D202E924C065CF00D1AF3A /* ActiveSpansPool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActiveSpansPool.swift; sourceTree = "<group>"; };
E1D203FB24C1884500D1AF3A /* ActiveSpansPoolTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActiveSpansPoolTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4095,6 +4098,7 @@
B3BBBCB0265E71C600943419 /* VitalMemoryReader.swift */,
B3FC3C0626526EFF00DEED9E /* VitalInfo.swift */,
9E9973F0268DF69500D8059B /* VitalInfoSampler.swift */,
E179FB4D28F80A6400CC2698 /* PerformanceMetric.swift */,
);
path = RUMVitals;
sourceTree = "<group>";
Expand Down Expand Up @@ -5201,6 +5205,7 @@
61E945E32869BF3D00A946C4 /* CoreLogger.swift in Sources */,
61133BCB2423979B00786299 /* CarrierInfoProvider.swift in Sources */,
61C5A89024509AA700DA608C /* TracingFeature.swift in Sources */,
E179FB4E28F80A6400CC2698 /* PerformanceMetric.swift in Sources */,
61E5333624B84B43003D6C4E /* RUMMonitor.swift in Sources */,
6156CB9824DEFD44008CB2B2 /* LoggingWithRUMIntegration.swift in Sources */,
9EB4B862274E79D50041CD03 /* WKUserContentController+Datadog.swift in Sources */,
Expand Down Expand Up @@ -5901,6 +5906,7 @@
D2CB6EB427C50EAE00A62B57 /* VitalInfoSampler.swift in Sources */,
D2CB6EB527C50EAE00A62B57 /* VitalRefreshRateReader.swift in Sources */,
D2CB6EB627C50EAE00A62B57 /* (null) in Sources */,
E179FB4F28F80A6400CC2698 /* PerformanceMetric.swift in Sources */,
D2CB6EB727C50EAE00A62B57 /* URLSessionTracingHandler.swift in Sources */,
D2CB6EB827C50EAE00A62B57 /* RUMEventSanitizer.swift in Sources */,
D2CB6EB927C50EAE00A62B57 /* DDError.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 1 addition & 1 deletion DatadogSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDK"
s.module_name = "Datadog"
s.version = "1.12.1"
s.version = "1.13.0"
s.summary = "Official Datadog Swift SDK for iOS."

s.homepage = "https://www.datadoghq.com"
Expand Down
2 changes: 1 addition & 1 deletion DatadogSDKAlamofireExtension.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDKAlamofireExtension"
s.module_name = "DatadogAlamofireExtension"
s.version = "1.12.1"
s.version = "1.13.0"
s.summary = "An Official Extensions of Datadog Swift SDK for Alamofire."

s.homepage = "https://www.datadoghq.com"
Expand Down
4 changes: 2 additions & 2 deletions DatadogSDKCrashReporting.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDKCrashReporting"
s.module_name = "DatadogCrashReporting"
s.version = "1.12.1"
s.version = "1.13.0"
s.summary = "Official Datadog Crash Reporting SDK for iOS."

s.homepage = "https://www.datadoghq.com"
Expand All @@ -22,6 +22,6 @@ Pod::Spec.new do |s|
s.static_framework = true

s.source_files = "Sources/DatadogCrashReporting/**/*.swift"
s.dependency 'DatadogSDK', '1.12.1'
s.dependency 'DatadogSDK', '1.13.0'
s.dependency 'PLCrashReporter', '~> 1.11.0'
end
4 changes: 2 additions & 2 deletions DatadogSDKObjc.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDKObjc"
s.module_name = "DatadogObjc"
s.version = "1.12.1"
s.version = "1.13.0"
s.summary = "Official Datadog Objective-C SDK for iOS."

s.homepage = "https://www.datadoghq.com"
Expand All @@ -21,5 +21,5 @@ Pod::Spec.new do |s|
s.source = { :git => 'https://github.com/DataDog/dd-sdk-ios.git', :tag => s.version.to_s }

s.source_files = "Sources/DatadogObjc/**/*.swift"
s.dependency 'DatadogSDK', '1.12.1'
s.dependency 'DatadogSDK', '1.13.0'
end
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
all: dependencies xcodeproj-httpservermock templates

# The release version of `dd-sdk-swift-testing` to use for tests instrumentation.
DD_SDK_SWIFT_TESTING_VERSION = 2.2.0-beta.6
DD_SDK_SWIFT_TESTING_VERSION = 2.2.0-rc.2

define DD_SDK_TESTING_XCCONFIG_CI
FRAMEWORK_SEARCH_PATHS[sdk=iphonesimulator*]=$$(inherited) $$(SRCROOT)/../instrumented-tests/DatadogSDKTesting.xcframework/ios-arm64_x86_64-simulator/\n
Expand Down
6 changes: 6 additions & 0 deletions Sources/Datadog/Core/Attributes/Attributes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,10 @@ internal struct CrossPlatformAttributes {
/// and send it within the RUM resource, so the RUM backend can issue corresponding APM span on behalf of the mobile app.
/// Expects `String` value.
static let spanID = "_dd.span_id"

/// Trace sample rate applied to RUM resources created by cross platform SDK.
/// We send cross-platform SDK's sample rate within RUM resource in order to provide accurate visibility into what settings are
/// configured at the SDK level. This gets displayed on APM's traffic ingestion control page.
/// Expects `Double` value between `0.0` and `1.0`.
static let rulePSR = "_dd.rule_psr"
}
6 changes: 5 additions & 1 deletion Sources/Datadog/Core/FeaturesConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ internal struct FeaturesConfiguration {
/// RUM auto instrumentation configuration, `nil` if not enabled.
let instrumentation: Instrumentation?
let backgroundEventTrackingEnabled: Bool
let frustrationTrackingEnabled: Bool
let onSessionStart: RUMSessionListener?
let firstPartyHosts: Set<String>
let vitalsFrequency: TimeInterval?
Expand All @@ -79,7 +80,9 @@ internal struct FeaturesConfiguration {
let instrumentTracing: Bool
/// If the RUM instrumentation should be enabled.
let instrumentRUM: Bool
// Tracing sampler
/// Tracing sampler to decide if trace should be generated for certain network request:
/// - if RUM instrumentation is enabled, it is used to sample traces generated by RUM BE,
/// - if RUM is disabled, it is used to sample traces generated by the SDK.
let tracingSampler: Sampler
}

Expand Down Expand Up @@ -221,6 +224,7 @@ extension FeaturesConfiguration {
longTaskEventMapper: configuration.rumLongTaskEventMapper,
instrumentation: instrumentation,
backgroundEventTrackingEnabled: configuration.rumBackgroundEventTrackingEnabled,
frustrationTrackingEnabled: configuration.rumFrustrationSignalsTrackingEnabled,
onSessionStart: configuration.rumSessionsListener,
firstPartyHosts: sanitizedHosts,
vitalsFrequency: configuration.mobileVitalsFrequency.timeInterval
Expand Down
10 changes: 10 additions & 0 deletions Sources/Datadog/DDRUMMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,16 @@ public class DDRUMMonitor {
/// - Parameter key: key for the attribute that will be removed.
public func removeAttribute(forKey key: AttributeKey) {}

/// Adds a record for a cross-platform performance metric
/// - Parameters:
/// - metric: the name of the performance metric.
/// - value: recorded value of the metric.
public func updatePerformanceMetric(
metric: PerformanceMetric,
value: Double,
attributes: [AttributeKey: AttributeValue] = [:]
) {}

public internal(set) var _internal: _RUMInternalProxy? = nil

// MARK: - Internal
Expand Down
13 changes: 13 additions & 0 deletions Sources/Datadog/Datadog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,19 @@ public class Datadog {
)
}

/// Add custom attributes to the current user information
///
/// This extra info will be added to already existing extra info that is added
/// to logs traces and RUM events automatically.
/// - Parameters:
/// - extraInfo: User's additionall custom attributes
public static func addUserExtraInfo(
_ extraInfo: [AttributeKey: AttributeValue?]
) {
let core = defaultDatadogCore as? DatadogCore
core?.addUserExtraInfo(extraInfo)
}

/// Sets the tracking consent regarding the data collection for the Datadog SDK.
/// - Parameter trackingConsent: new consent value, which will be applied for all data collected from now on
public static func set(trackingConsent: TrackingConsent) {
Expand Down
15 changes: 14 additions & 1 deletion Sources/Datadog/DatadogConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ extension Datadog {
private(set) var rumLongTaskEventMapper: RUMLongTaskEventMapper?
private(set) var rumResourceAttributesProvider: URLSessionRUMAttributesProvider?
private(set) var rumBackgroundEventTrackingEnabled: Bool
private(set) var rumFrustrationSignalsTrackingEnabled: Bool
private(set) var rumTelemetrySamplingRate: Float
private(set) var mobileVitalsFrequency: VitalsFrequency
private(set) var batchSize: BatchSize
Expand Down Expand Up @@ -353,8 +354,9 @@ extension Datadog {
rumErrorEventMapper: nil,
rumResourceAttributesProvider: nil,
rumBackgroundEventTrackingEnabled: false,
rumFrustrationSignalsTrackingEnabled: true,
rumTelemetrySamplingRate: 20,
mobileVitalsFrequency: .rare,
mobileVitalsFrequency: .average,
batchSize: .medium,
uploadFrequency: .average,
additionalConfiguration: [:],
Expand Down Expand Up @@ -729,6 +731,17 @@ extension Datadog {
return self
}

/// Enables or disables automatic collection of user frustrations.
///
/// The Datadog SDK currently support detection of `error_tap` frustration, which is detected when
/// an error follows a user tap action.
///
/// - Parameter enabled: `true` by default
public func trackFrustrations(_ enabled: Bool = true) -> Builder {
configuration.rumFrustrationSignalsTrackingEnabled = enabled
return self
}

/// Sets the sampling rate for Internal Telemetry (info related to the work of the SDK internals). Default value is 20.
///
/// - Parameter rate: the sampling rate must be a value between 0 and 100. A value of 0
Expand Down
10 changes: 10 additions & 0 deletions Sources/Datadog/DatadogCore/DatadogCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ internal final class DatadogCore {
)
}

/// Add or override the extra info of the current user
///
/// - Parameters:
/// - extraInfo: The user's custom attibutes to add or override
func addUserExtraInfo(_ newExtraInfo: [AttributeKey: AttributeValue?]) {
var extraInfo = dependencies.userInfoProvider.value.extraInfo
newExtraInfo.forEach { extraInfo[$0.key] = $0.value }
dependencies.userInfoProvider.value.extraInfo = extraInfo
}

/// Sets the tracking consent regarding the data collection for the Datadog SDK.
///
/// - Parameter trackingConsent: new consent value, which will be applied for all data collected from now on
Expand Down
2 changes: 1 addition & 1 deletion Sources/Datadog/DatadogInternal/_InternalProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Foundation
/// are not considered part of the public interface of the Datadog SDK.
public class _InternalProxy {
public let _configuration = _ConfigurationProxy()
public let _telemtry = _TelemetryProxy()
public let _telemetry = _TelemetryProxy()
}

public class _TelemetryProxy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,19 @@ internal struct CrashReportingWithRUMIntegration: CrashReportingIntegration {
domContentLoaded: original.view.domContentLoaded,
domInteractive: original.view.domInteractive,
error: original.view.error,
firstByte: nil,
firstContentfulPaint: original.view.firstContentfulPaint,
firstInputDelay: original.view.firstInputDelay,
firstInputTime: original.view.firstInputTime,
flutterBuildTime: nil,
flutterRasterTime: nil,
frozenFrame: nil,
frustration: nil,
id: original.view.id,
inForegroundPeriods: original.view.inForegroundPeriods,
isActive: false,
isSlowRendered: nil,
jsRefreshRate: nil,
largestContentfulPaint: original.view.largestContentfulPaint,
loadEvent: original.view.loadEvent,
loadingTime: original.view.loadingTime,
Expand Down Expand Up @@ -383,15 +387,19 @@ internal struct CrashReportingWithRUMIntegration: CrashReportingIntegration {
domContentLoaded: nil,
domInteractive: nil,
error: .init(count: 0),
firstByte: nil,
firstContentfulPaint: nil,
firstInputDelay: nil,
firstInputTime: nil,
flutterBuildTime: nil,
flutterRasterTime: nil,
frozenFrame: nil,
frustration: nil,
id: viewUUID.toRUMDataFormat,
inForegroundPeriods: nil,
isActive: false, // we know it won't receive updates
isSlowRendered: nil,
jsRefreshRate: nil,
largestContentfulPaint: nil,
loadEvent: nil,
loadingTime: nil,
Expand Down
Loading

0 comments on commit 10a027a

Please sign in to comment.