Skip to content

Commit

Permalink
Merge pull request #261 from Automattic/feat/option-to-config-sentry
Browse files Browse the repository at this point in the history
Add options to config Sentry app hang and HTTP client error tracking
  • Loading branch information
itsmeichigo authored Aug 2, 2023
2 parents 01e7397 + d841ba6 commit aad902b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Automattic-Tracks-iOS.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Pod::Spec.new do |s|
s.name = 'Automattic-Tracks-iOS'
s.version = '2.2.0'
s.version = '2.3.0'

s.summary = 'Simple way to track events in an iOS app with Automattic Tracks internal service'
s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ _None._
-->

## Unreleased
## 2.3.0

### Breaking Changes

_None._

### New Features

_None._
- Add options to configure Sentry's app hang and HTTP client error tracking. [#261]

### Bug Fixes

Expand Down
2 changes: 1 addition & 1 deletion Sources/Model/ObjC/Constants/TracksConstants.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "TracksConstants.h"

NSString *const TracksErrorDomain = @"TracksErrorDomain";
NSString *const TracksLibraryVersion = @"2.2.0";
NSString *const TracksLibraryVersion = @"2.3.0";
2 changes: 2 additions & 0 deletions Sources/Remote Logging/Crash Logging/CrashLogging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class CrashLogging {
options.environment = self.dataProvider.buildType
options.releaseName = self.dataProvider.releaseName
options.enableAutoSessionTracking = self.dataProvider.shouldEnableAutomaticSessionTracking
options.enableAppHangTracking = self.dataProvider.enableAppHangTracking
options.enableCaptureFailedRequests = self.dataProvider.enableCaptureFailedRequests

options.beforeSend = self.beforeSend

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ public protocol CrashLoggingDataProvider {
var additionalUserData: [String: Any] { get }
var shouldEnableAutomaticSessionTracking: Bool { get }
var performanceTracking: PerformanceTracking { get }
/// Whether app hang are captured.
var enableAppHangTracking: Bool { get }
/// Whether HTTP client errors are captured.
var enableCaptureFailedRequests: Bool { get }
}

/// Default implementations of common protocol properties
Expand Down Expand Up @@ -80,4 +84,14 @@ public extension CrashLoggingDataProvider {
guard case .enabled(let config) = performanceTracking else { return false }
return config.trackUserInteraction
}

/// App hang tracking is disabled by default to avoid unexpected events being tracked.
var enableAppHangTracking: Bool {
return false
}

/// HTTP client errors are disabled by default to avoid unexpected events being tracked.
var enableCaptureFailedRequests: Bool {
return false
}
}

0 comments on commit aad902b

Please sign in to comment.