-
Notifications
You must be signed in to change notification settings - Fork 129
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
RUMM-664: Shopist demo runs #225
Conversation
2d6f7d9
to
84c3676
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about other Shopist scenarios? I can see at least 6 distinct stories in Android Shopist Demo.
- There is a
TODO
left inShopist.xcconfig
:
// TODO: RUMM-664 temporary value, otherwise test cases fail in CI
RUM_APPLICATION_ID=12345 // use your own RUM Application ID obtained on datadoghq.com
52694bf
to
9e6cba9
Compare
9e6cba9
to
e8e5675
Compare
9601551
to
c59efc8
Compare
|
0d00100
to
7c2ebd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a9af852
to
41f9c3b
Compare
41f9c3b
to
e69ab29
Compare
e69ab29
to
fe00b1a
Compare
c495993
to
19f5911
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few inline feedbacks and two questions:
- what about the IP randomization? I think we need a JIRA to address this.
- when will we configure the
shopist_demo
trigger? I think we need a JIRA to address this.
Shopist/Shopist/API.swift
Outdated
if let someError = response.error { | ||
|
||
let tracer = Global.sharedTracer | ||
let span = tracer.startSpan(operationName: request.url?.path ?? "network request").setActive() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This usage of setActive()
span is against the intention and will produce wrong traces if several requests are started simultaneously.
As we want the "network request" span to be the parent of "decoding response data" span, we should either:
- set it explicitly:
tracer.startSpan(operationName: "decoding response data", childOf: span.context)
, - use
setRootSpan().setActive()
API introduced in RUMM-675 Addtracer.startRootSpan()
API #236 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 setRootSpan
wasn't available during dev of this PR
Shopist/Shopist/API.swift
Outdated
rum?.startResourceLoading( | ||
resourceName: resourceName, | ||
url: fontURL, | ||
httpMethod: .POST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GET
seems more natural for fetching the font.
Shopist/Shopist/AppDelegate.swift
Outdated
@@ -42,6 +75,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { | |||
|
|||
// Register global `RUMMonitor` | |||
Global.rum = RUMMonitor.initialize() | |||
rum?.addAttribute(forKey: "usr.handle", value: user.email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
historical reasons i guess. when android did their shopist, rum-events
wasn't around and they used usr.handle
instead. sales people still seem to look for it (although they can get the same info from usr.email
now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, clear 👌. Maybe it's worth adding the comment above that coded, so this can be removed in the future once everyone sells it by usr.email
🙌.
Shopist/Shopist/AppDelegate.swift
Outdated
fileprivate(set) var logger: Logger! | ||
internal fileprivate(set) var logger: Logger! // swiftlint:disable:this implicitly_unwrapped_optional | ||
internal let appConfig = AppConfig(serviceName: "ios-sdk-shopist-app") | ||
internal var rum: DDRUMMonitor? { Global.rum } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Global.rum
is no longer optional. Also - do we need this? Why not using Global.rum
everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Global.rum
wasn't around when this PR started, i used global rum
variable first and it stayed. we can replace them now
Shopist/Shopist/AppDelegate.swift
Outdated
// Initialize Datadog SDK | ||
Datadog.initialize( | ||
appContext: .init(), | ||
configuration: Datadog.Configuration | ||
.builderUsing( | ||
rumApplicationID: appConfig.rumAppID, | ||
clientToken: appConfig.rumClientToken, | ||
clientToken: appConfig.clientToken, | ||
environment: "tests" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shop.ist
is an illegal service name, apparently .
is invalid char
i make it shopist
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we have a different definition of valid env
between platforms. This must be unified. I created JIRA, so this will be addressed later:
RUMM-700 Investigate the
envname validation in Android RUM and iOS RUM
Shopist/Shopist/AppDelegate.swift
Outdated
@@ -7,29 +7,62 @@ | |||
import UIKit | |||
import Datadog | |||
|
|||
fileprivate(set) var logger: Logger! | |||
internal fileprivate(set) var logger: Logger! // swiftlint:disable:this implicitly_unwrapped_optional | |||
internal let appConfig = AppConfig(serviceName: "ios-sdk-shopist-app") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 now appConfig.serviceName
(io.shopist.ios
) is used in DatadogConfiguration
// randomizing cacheKey forces to make new request | ||
let cacheKey = UUID().uuidString |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we use Alamofire's in-build caching API to disable caching? Defining empty AutoPurgingImageCache
should do the same, but it's using regular API instead of hacking it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AF docs says we should use config.urlCache = nil
while init'ing ImageDownloader
done ✅
|
||
override func viewDidAppear(_ animated: Bool) { | ||
super.viewDidAppear(animated) | ||
viewDidAppearDate = Date() | ||
} | ||
|
||
override func viewWillDisappear(_ animated: Bool) { | ||
super.viewWillDisappear(animated) | ||
rum?.stopView(viewController: self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
19f5911
to
168a065
Compare
we have a ticket for that ✅
based on Android team's experience, this should be an almost-trivial task. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What and why?
We need Shopist app to generate RUM demo data
How?
The app was implemented, this PR implements its UI tests and CI configuration to run them
Also this PR contains linter error fixes in Shopist project
⚠️ In order to make review easier, you can filter "Shopist CI setup is done" commit ⚠️
Visuals
CartViewController
has resources, traces, actions, errors and logs ✅Review checklist