diff --git a/WireAnalytics/Sources/WireDatadog/WireDatadog.swift b/WireAnalytics/Sources/WireDatadog/WireDatadog.swift index 22a76a465fd..dc9c7673918 100644 --- a/WireAnalytics/Sources/WireDatadog/WireDatadog.swift +++ b/WireAnalytics/Sources/WireDatadog/WireDatadog.swift @@ -21,6 +21,7 @@ public import WireLogging import CryptoKit import DatadogCore +import DatadogCrashReporting import DatadogLogs import DatadogTrace import UIKit @@ -65,6 +66,8 @@ public final class WireDatadog { trackingConsent: .granted ) + CrashReporting.enable() + let logsConfiguration = Logs.Configuration() Logs.enable(with: logsConfiguration) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index a8f3c4359ee..04a43fe6e48 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -234,6 +234,7 @@ platform :ios do lane :development do |options| options[:build_type] = "Development" options[:upload_testflight] = true + options[:upload_dsyms_to_datadog] = true options[:extra_distribution_groups] = ["Wire Employees"] options[:produce_debug_builds] = true options[:countly_api_key] = ENV['COUNTLY_INTERNAL_KEY'] @@ -246,6 +247,7 @@ platform :ios do lane :playground do |options| options[:build_type] = "Playground" options[:upload_testflight] = true + options[:upload_dsyms_to_datadog] = true options[:extra_distribution_groups] = ["Wire Employees", "Externals - Non Wire Employees"] options[:produce_debug_builds] = true options[:countly_api_key] = ENV['COUNTLY_INTERNAL_KEY'] @@ -258,6 +260,7 @@ platform :ios do lane :testflight_beta do |options| options[:build_type] = "Beta" options[:upload_testflight] = true + options[:upload_dsyms_to_datadog] = true options[:produce_debug_builds] = true options[:countly_api_key] = ENV['COUNTLY_INTERNAL_KEY'] options[:extra_distribution_groups] = ["Wire Employees", "Externals - Non Wire Employees"] @@ -424,6 +427,10 @@ platform :ios do sha256(options) upload_s3(options) save_changelog_to_env(options) + + if options[:upload_dsyms_to_datadog] || false + upload_dsyms_to_datadog(options) + end end def save_app_name(name) @@ -919,6 +926,19 @@ platform :ios do changelog = changelog(build) `export TEMP='RELEASE_NOTES=#{Base64.strict_encode64(changelog)}' && echo $TEMP >> ./.post_build/.env` end + + # Upload dsyms to Datadog + def upload_dsyms_to_datadog(options) + build = Build.new(options: options) + + upload_symbols_to_datadog( + api_key: ENV["DATADOG_API_KEY"], + dsym_paths: [ + "#{build.artifact_path(with_filename: true)}.app.dSYM.zip" + ], + site: "datadoghq.eu" + ) + end end class Build diff --git a/wire-ios/Wire-iOS/Sources/Developer/DeveloperTools/DeveloperToolsViewModel.swift b/wire-ios/Wire-iOS/Sources/Developer/DeveloperTools/DeveloperToolsViewModel.swift index 238eeff25b8..66cf380aea7 100644 --- a/wire-ios/Wire-iOS/Sources/Developer/DeveloperTools/DeveloperToolsViewModel.swift +++ b/wire-ios/Wire-iOS/Sources/Developer/DeveloperTools/DeveloperToolsViewModel.swift @@ -251,7 +251,8 @@ final class DeveloperToolsViewModel: ObservableObject { sections.append(Section( header: "Datadog", items: [ - .text(TextItem(title: "User ID", value: datadogUserIdentifier)) + .text(TextItem(title: "User ID", value: datadogUserIdentifier)), + .button(.init(title: "Crash Report Test", action: { fatal("crash app") })) ] )) }