Skip to content

Commit

Permalink
Merge pull request #1381 from DataDog/release/1.22.0
Browse files Browse the repository at this point in the history
Release `1.22.0`
  • Loading branch information
ncreated authored Jul 21, 2023
2 parents 757257b + eb5bd44 commit ac1e081
Show file tree
Hide file tree
Showing 110 changed files with 2,489 additions and 776 deletions.
5 changes: 5 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1
builder:
configs:
- platform: ios
documentation_targets: ["Datadog", "DatadogObjc", "DatadogCrashReporting"]
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Unreleased

# 1.21.0 / 27-07-2023
# 1.22.0 / 21-07-2023
- [BUGFIX] Fix APM local spans not correlating with RUM views. See [#1355][]
- [IMPROVEMENT] Reduce number of view updates by filtering events from payload. See [#1328][]

# 1.21.0 / 27-06-2023
- [BUGFIX] Fix TracingUUID string format. See [#1311][] (Thanks [@changm4n][])
- [BUGFIX] Rename _Datadog_Private to DatadogPrivate. See [#1331] (Thanks [@alexfanatics][])
- [IMPROVEMENT] Add context to crash when there's an active view. See [#1315][]


# 1.20.0 / 01-06-2023
- [BUGFIX] Use targetTimestamp as reference to calculate FPS for variable refresh rate displays. See [#1272][]

Expand Down Expand Up @@ -472,6 +477,8 @@
[#1311]: https://github.com/DataDog/dd-sdk-ios/pull/1311
[#1315]: https://github.com/DataDog/dd-sdk-ios/pull/1315
[#1331]: https://github.com/DataDog/dd-sdk-ios/pull/1331
[#1328]: https://github.com/DataDog/dd-sdk-ios/pull/1328
[#1355]: https://github.com/DataDog/dd-sdk-ios/pull/1355
[@00fa9a]: https://github.com/00FA9A
[@britton-earnin]: https://github.com/Britton-Earnin
[@hengyu]: https://github.com/Hengyu
Expand Down
44 changes: 32 additions & 12 deletions Datadog/Datadog.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 2 additions & 0 deletions Datadog/Example/AppConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ struct ExampleAppConfiguration: AppConfiguration {
.enableRUM(true)
.enableCrashReporting(using: DDCrashReportingPlugin())
.trackBackgroundEvents()
.trackURLSession()
.set(tracingSamplingRate: 100)
}

return configuration.build()
Expand Down
153 changes: 121 additions & 32 deletions Datadog/Example/Debugging/DebugRUMSessionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ private class DebugRUMSessionViewModel: ObservableObject {
@Published var errorMessage: String = ""
@Published var resourceKey: String = ""

@Published var logMessage: String = ""
@Published var spanOperationName: String = ""
@Published var instrumentedRequestURL: String = "https://api.shopist.io/checkout.json"

var urlSessions: [URLSession] = []

func startView() {
guard !viewKey.isEmpty else {
return
Expand Down Expand Up @@ -74,7 +80,11 @@ private class DebugRUMSessionViewModel: ObservableObject {
)

Global.rum.addUserAction(type: .custom, name: actionName)
self.actionName = ""

DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) {
self.sendSpan()
self.actionName = ""
}
}

func addError() {
Expand Down Expand Up @@ -115,6 +125,45 @@ private class DebugRUMSessionViewModel: ObservableObject {
self.resourceKey = ""
}

func sendLog() {
logger.debug(logMessage)
logMessage = ""
}

func sendSpan() {
let span = Global.sharedTracer.startRootSpan(operationName: spanOperationName, tags: [:])
Thread.sleep(forTimeInterval: 0.1)
span.finish()
spanOperationName = ""
}

func sendPOSTRequest() {
guard let url = URL(string: instrumentedRequestURL) else {
print("🔥 POST Request not sent - invalid url: \(instrumentedRequestURL)")
return
}
guard let host = url.host else {
print("🔥 POST Request not sent - invalid url host: \(instrumentedRequestURL)")
return
}

let delegate = DDURLSessionDelegate(additionalFirstPartyHosts: [host])
let session = URLSession(configuration: .ephemeral, delegate: delegate, delegateQueue: nil)

var request = URLRequest(url: url)
request.httpMethod = "POST"
let task = session.dataTask(with: request) { _, _, error in
if let error = error {
print("🌍🔥 POST \(url) completed with network error: \(error)")
} else {
print("🌍 POST \(url) sent successfully")
}
}
task.resume()

urlSessions.append(session) // keep session
}

// MARK: - Private

private func modifySessionItem(type: SessionItemType, label: String, change: (inout SessionItem) -> Void) {
Expand All @@ -138,40 +187,80 @@ internal struct DebugRUMSessionView: View {

var body: some View {
VStack() {
HStack {
FormItemView(
title: "RUM View", placeholder: "view key", accent: .rumViewColor, value: $viewModel.viewKey
)
Button("START") { viewModel.startView() }
}
HStack {
FormItemView(
title: "RUM Action", placeholder: "name", accent: .rumActionColor, value: $viewModel.actionName
)
Button("ADD") { viewModel.addAction() }
}
HStack {
FormItemView(
title: "RUM Error", placeholder: "message", accent: .rumErrorColor, value: $viewModel.errorMessage
)
Button("ADD") { viewModel.addError() }
Group {
Text("RUM Session")
.frame(maxWidth: .infinity, alignment: .leading)
.font(.caption.weight(.bold))
Text("Debug RUM Session by creating events manually:")
.frame(maxWidth: .infinity, alignment: .leading)
.font(.caption.weight(.light))
HStack {
FormItemView(
title: "RUM View", placeholder: "view key", accent: .rumViewColor, value: $viewModel.viewKey
)
Button("START") { viewModel.startView() }
}
HStack {
FormItemView(
title: "RUM Action", placeholder: "name", accent: .rumActionColor, value: $viewModel.actionName
)
Button("ADD") { viewModel.addAction() }
}
HStack {
FormItemView(
title: "RUM Error", placeholder: "message", accent: .rumErrorColor, value: $viewModel.errorMessage
)
Button("ADD") { viewModel.addError() }
}
HStack {
FormItemView(
title: "RUM Resource", placeholder: "key", accent: .rumResourceColor, value: $viewModel.resourceKey
)
Button("START") { viewModel.startResource() }
}
Divider()
}
HStack {
FormItemView(
title: "RUM Resource", placeholder: "key", accent: .rumResourceColor, value: $viewModel.resourceKey
)
Button("START") { viewModel.startResource() }
Group {
Text("Bundling Logs and Spans")
.frame(maxWidth: .infinity, alignment: .leading)
.font(.caption.weight(.bold))
Text("Debug bundling Logs and Spans with RUM Session by sending them manually while the session is active.")
.frame(maxWidth: .infinity, alignment: .leading)
.font(.caption.weight(.light))
HStack {
FormItemView(
title: "Log", placeholder: "log message", accent: .gray, value: $viewModel.logMessage
)
Button("Send") { viewModel.sendLog() }
}
HStack {
FormItemView(
title: "Span", placeholder: "span name", accent: .gray, value: $viewModel.spanOperationName
)
Button("Send") { viewModel.sendSpan() }
}
Text("Send 1st party request with instrumented URLSession:")
.frame(maxWidth: .infinity, alignment: .leading)
.font(.caption.weight(.light))
HStack {
FormItemView(
title: "POST Request", placeholder: "request url", accent: .gray, value: $viewModel.instrumentedRequestURL
)
Button("Send") { viewModel.sendPOSTRequest() }
}
Divider()
}
Divider()
Text("RUM Session:")
.bold()
.font(.footnote)
List(viewModel.sessionItems) { sessionItem in
SessionItemView(item: sessionItem)
.listRowInsets(EdgeInsets())
.padding(4)
Group {
Text("Current RUM Session:")
.frame(maxWidth: .infinity, alignment: .leading)
.font(.caption.weight(.bold))
List(viewModel.sessionItems) { sessionItem in
SessionItemView(item: sessionItem)
.listRowInsets(EdgeInsets())
.padding(4)
}
.listStyle(PlainListStyle())
}
.listStyle(PlainListStyle())
}
.buttonStyle(DatadogButtonStyle())
.padding()
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.21.0"
s.version = "1.22.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.21.0"
s.version = "1.22.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.21.0"
s.version = "1.22.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.21.0'
s.dependency 'DatadogSDK', '1.22.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.21.0"
s.version = "1.22.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.21.0'
s.dependency 'DatadogSDK', '1.22.0'
end
2 changes: 1 addition & 1 deletion DatadogSDKSessionReplay.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "DatadogSDKSessionReplay"
s.module_name = "DatadogSessionReplay"
s.version = "1.21.0"
s.version = "1.22.0"
s.summary = "Official Datadog Session Replay SDK for iOS. This module is currently in beta - contact Datadog to request a try."

s.homepage = "https://www.datadoghq.com"
Expand Down
Loading

0 comments on commit ac1e081

Please sign in to comment.