Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to config Sentry app hang and HTTP client error tracking #261

Merged
merged 6 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 enabled by default.
var enableAppHangTracking: Bool {
return true
}

/// HTTP client errors are captured by default.
var enableCaptureFailedRequests: Bool {
return true
}
itsmeichigo marked this conversation as resolved.
Show resolved Hide resolved
}