Skip to content

Commit

Permalink
Mobile Session Replay, SDK Update, Disable Metrics (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
kpujjigit authored Nov 20, 2024
1 parent a9897f9 commit 89aff47
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa",
"state" : {
"revision" : "5575af93efb776414f243e93d6af9f6258dc539a",
"version" : "8.36.0"
"revision" : "0ffc3c6287461962cb2a81e57fc0ee0335d8d56a",
"version" : "8.40.1"
}
}
],
"version" : 2
"version" : 3
}
6 changes: 5 additions & 1 deletion EmpowerPlant/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
options.attachViewHierarchy = true
options.enableSwizzling = enableSwizzling
options.enablePerformanceV2 = true
options.enableMetrics = true
// options.enableMetrics = true

// Enable Mobile Session Replay
options.experimental.sessionReplay.onErrorSampleRate = 1.0
options.experimental.sessionReplay.sessionSampleRate = 1.0
}
SentrySDK.configureScope{ scope in
scope.setTag(value: ["corporate", "enterprise", "self-serve"].randomElement() ?? "unknown", key: "customer.type")
Expand Down
4 changes: 2 additions & 2 deletions EmpowerPlant/CartViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ class CartViewController: UIViewController, UITableViewDelegate, UITableViewData
if let httpResponse = response as? HTTPURLResponse {
if (httpResponse.statusCode) == 500 {
print("> 500 response")
SentrySDK.metrics.increment(key: "checkout.error")
//SentrySDK.metrics.increment(key: "checkout.error")
let err = PurchaseError.insufficientInventory
SentrySDK.capture(error: err) //Empowerplant Flagship Error
} else {
SentrySDK.metrics.increment(key: "checkout.success")
//SentrySDK.metrics.increment(key: "checkout.success")
}
}

Expand Down
6 changes: 3 additions & 3 deletions EmpowerPlant/EmpowerPlantViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,12 @@ class EmpowerPlantViewController: UIViewController {
let task = URLSession.shared.dataTask(with: url) { data, response, error in
let endTime = Date()
let duration = endTime.timeIntervalSince(startTime)
SentrySDK.metrics.distribution(
/*SentrySDK.metrics.distribution(
key: "products_request.duration",
value: duration,
unit: MeasurementUnitDuration.millisecond,
tags: ["endpoint": urlStr]
)
)*/

if let data = data {
if let productsResponse = try? JSONDecoder().decode([ProductMap].self, from: data) {
Expand Down Expand Up @@ -370,7 +370,7 @@ class EmpowerPlantViewController: UIViewController {

@objc
func goToCart() {
SentrySDK.metrics.increment(key: "checkout.click")
//SentrySDK.metrics.increment(key: "checkout.click")
self.performSegue(withIdentifier: "goToCart", sender: self)
}

Expand Down

0 comments on commit 89aff47

Please sign in to comment.