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

feat: UI event transactions for clicks #1784

Merged
merged 60 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
4b957c7
ref: Add SwizzleWrapper
philipphofmann Apr 19, 2022
ddfe60f
fix build failure for macos
philipphofmann Apr 19, 2022
cd8bc8b
backup
philipphofmann Apr 19, 2022
c2ab781
Merge branch 'master' into feat/ui-transactions
philipphofmann Apr 20, 2022
a1bcba5
backup
philipphofmann Apr 20, 2022
5247a2b
backup
philipphofmann Apr 25, 2022
1f8d5c1
Merge branch 'master' into feat/ui-transactions
philipphofmann Apr 26, 2022
a43dd3f
backup
philipphofmann Apr 26, 2022
5ddbcb0
backup
philipphofmann Apr 27, 2022
7aa8e84
UI Event transaction info
brustolin Apr 28, 2022
89ccf05
Merge branch 'feat/ui-transactions' of https://github.com/getsentry/s…
brustolin Apr 28, 2022
293cb7f
Checking for span in the scope
brustolin Apr 28, 2022
7acfffe
trim transaction
philipphofmann Apr 28, 2022
8147c9c
Merge branch 'master' into feat/ui-transactions
philipphofmann Apr 28, 2022
b9e2ca3
Format code
getsentry-bot Apr 28, 2022
94c06c3
Update SentrySwizzleWrapperTests.swift
brustolin Apr 28, 2022
4a04183
Format code
getsentry-bot Apr 28, 2022
2ee431f
fix tests
brustolin Apr 28, 2022
fe1a009
Merge branch 'feat/ui-transactions' of https://github.com/getsentry/s…
brustolin Apr 28, 2022
df7eaf7
IdleTransaction only with waitForChildren
philipphofmann Apr 28, 2022
600930f
feat: Create transaction from UI events (#1791)
brustolin May 12, 2022
49959d2
Merge branch 'master' into feat/ui-transactions
philipphofmann May 12, 2022
8aa92e2
Fix waiting for all children
philipphofmann May 12, 2022
1f9a875
Add isWaitingForChildren again
philipphofmann May 12, 2022
7455edc
button click
philipphofmann May 12, 2022
4d2dd84
More logic
philipphofmann May 13, 2022
e63fe84
Format code
getsentry-bot May 13, 2022
2b44ba8
Merge branch 'master' into feat/ui-transactions
philipphofmann May 16, 2022
96d42dd
More logic
philipphofmann May 16, 2022
f37dad5
Merge branch 'master' into feat/ui-transactions
philipphofmann May 17, 2022
274945f
More edge cases
philipphofmann May 17, 2022
8a5921b
Test cleanup
philipphofmann May 17, 2022
eb0a093
Fix for macOS
philipphofmann May 17, 2022
8b3a8ed
Improve perf of trimEndTimestamp
philipphofmann May 17, 2022
f7e0767
Xcode 12 fixes
philipphofmann May 17, 2022
131ac3c
Fix operations
philipphofmann May 17, 2022
253e528
Fix macOS again
philipphofmann May 17, 2022
8489a86
Changelog entry
philipphofmann May 17, 2022
8a417c8
Fix again
philipphofmann May 17, 2022
b16e573
Fix status
philipphofmann May 17, 2022
b3ccfea
Make all touches clicks
philipphofmann May 17, 2022
641d932
Fix click logic
philipphofmann May 17, 2022
6bb5e03
Swift selector syntax
philipphofmann May 17, 2022
d6d9cbd
Trim end timestamp when cancelling
philipphofmann May 17, 2022
c0df0ce
Update Samples/iOS-Swift/iOS-Swift/ViewController.swift
philipphofmann May 17, 2022
fef0a3e
Enable in sample apps
philipphofmann May 18, 2022
aaa5092
enable all views
philipphofmann May 18, 2022
fa3a1aa
Add idleTimeout option
philipphofmann May 18, 2022
a7cd53e
Add experimental note
philipphofmann May 18, 2022
30a903b
Add smoke test
philipphofmann May 18, 2022
596cb00
Merge branch 'master' into feat/ui-transactions
philipphofmann May 19, 2022
fa424a3
Ignore SwiftUI
philipphofmann May 19, 2022
57d7d88
SwiftLint
philipphofmann May 19, 2022
db9a646
Clarify testIdleTimeout_TwoChildren_FirstFinishes_WaitsForTheOther
philipphofmann May 19, 2022
2b770f4
Fix transaction not finished issue
philipphofmann May 19, 2022
2b42db4
Limit scope lock
philipphofmann May 19, 2022
f403c43
Merge branch 'master' into feat/ui-transactions
philipphofmann May 19, 2022
ed463af
comment
philipphofmann May 19, 2022
08fe3c2
set callback to nil after executing it
philipphofmann May 19, 2022
e56cdd9
comment
philipphofmann May 19, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Features

- UI event transactions for clicks (#1784)
- Collect queue label information for profiles (#1828)
- Use the macho format for debug information in Profiling (#1830)
- Allow partial SDK info override (#1816)
Expand Down
1 change: 1 addition & 0 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ - (BOOL)application:(UIApplication *)application
options.tracesSampleRate = @1.0;
options.enableFileIOTracking = YES;
options.attachScreenshot = YES;
options.enableUserInteractionTracing = YES;
}];

return YES;
Expand Down
1 change: 1 addition & 0 deletions Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
options.enableCoreDataTracking = true
options.enableProfiling = true
options.attachScreenshot = true
options.enableUserInteractionTracing = true
}

return true
Expand Down
84 changes: 47 additions & 37 deletions Samples/iOS-Swift/iOS-Swift/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

24 changes: 13 additions & 11 deletions Samples/iOS-Swift/iOS-Swift/Tools/UIAssert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ class UIAssert {
guard let window = UIApplication.shared.delegate?.window else { return }
guard let target = window else { return }

if view.superview != target {
view.removeFromSuperview()

target.addSubview(view)

let constraints = [
view.leftAnchor.constraint(equalTo: target.leftAnchor, constant: 0),
view.rightAnchor.constraint(equalTo: target.rightAnchor, constant: 0),
view.bottomAnchor.constraint(equalTo: target.bottomAnchor, constant: 0)
]
NSLayoutConstraint.activate(constraints)
DispatchQueue.main.async {
if self.view.superview != target {
self.view.removeFromSuperview()

target.addSubview(self.view)

let constraints = [
self.view.leftAnchor.constraint(equalTo: target.leftAnchor, constant: 0),
self.view.rightAnchor.constraint(equalTo: target.rightAnchor, constant: 0),
self.view.bottomAnchor.constraint(equalTo: target.bottomAnchor, constant: 0)
]
NSLayoutConstraint.activate(constraints)
}
}
}

Expand Down
16 changes: 16 additions & 0 deletions Samples/iOS-Swift/iOS-Swift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class ViewController: UIViewController {
self.dsnTextField.backgroundColor = UIColor.systemGreen
}
}

}

@IBAction func addBreadcrumb(_ sender: Any) {
Expand All @@ -58,6 +59,21 @@ class ViewController: UIViewController {
print("\(String(describing: eventId))")
}

@IBAction func uiClickTransaction(_ sender: Any) {
dispatchQueue.async {
if let path = Bundle.main.path(forResource: "LoremIpsum", ofType: "txt") {
_ = FileManager.default.contents(atPath: path)
}
}

guard let imgUrl = URL(string: "https://sentry-brand.storage.googleapis.com/sentry-logo-black.png") else {
return
}
let session = URLSession(configuration: URLSessionConfiguration.default)
let dataTask = session.dataTask(with: imgUrl) { (_, _, _) in }
dataTask.resume()
}

@IBAction func captureUserFeedback(_ sender: Any) {
let error = NSError(domain: "UserFeedbackErrorDomain", code: 0, userInfo: [NSLocalizedDescriptionKey: "This never happens."])

Expand Down
4 changes: 4 additions & 0 deletions Samples/iOS-Swift/iOS-SwiftUITests/LaunchUITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class LaunchUITests: XCTestCase {
assertApp()
}

func testUiClickTransaction() {
app.buttons["uiClickTransactionButton"].tap()
}

func testCaptureError() {
app.buttons["Error"].tap()
}
Expand Down
1 change: 1 addition & 0 deletions Samples/iOS-SwiftUI/iOS-SwiftUI/SwiftUIApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct SwiftUIApp: App {
options.tracesSampleRate = 1.0
options.enableFileIOTracking = true
options.enableProfiling = true
options.enableUserInteractionTracing = true
}
}

Expand Down
1 change: 1 addition & 0 deletions Samples/iOS15-SwiftUI/iOS15-SwiftUI/App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct SwiftUIApp: App {
options.tracesSampleRate = 1.0
options.enableFileIOTracking = true
options.enableProfiling = true
options.enableUserInteractionTracing = true
}
}

Expand Down
1 change: 1 addition & 0 deletions Samples/tvOS-Swift/tvOS-Swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Sampling 100% - In Production you probably want to adjust this
options.tracesSampleRate = 1.0
options.enableFileIOTracking = true
options.enableUserInteractionTracing = true
}

SentrySDK.configureScope { scope in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,46 @@
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/watchOS-Swift WatchKit App">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B82C48224C98A93002CA6D1"
BuildableName = "watchOS-Swift WatchKit App.app"
BlueprintName = "watchOS-Swift WatchKit App"
ReferencedContainer = "container:watchOS-Swift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<RemoteRunnable
runnableDebuggingMode = "2"
BundleIdentifier = "com.apple.Carousel"
RemotePath = "/watchOS-Swift WatchKit App">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B82C48224C98A93002CA6D1"
BuildableName = "watchOS-Swift WatchKit App.app"
BlueprintName = "watchOS-Swift WatchKit App"
ReferencedContainer = "container:watchOS-Swift.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7B82C48224C98A93002CA6D1"
BuildableName = "watchOS-Swift WatchKit App.app"
BlueprintName = "watchOS-Swift WatchKit App"
ReferencedContainer = "container:watchOS-Swift.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
Loading