-
Notifications
You must be signed in to change notification settings - Fork 127
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
application_start
event is not sent for Datadog sdk version >= 2.6.0
#2041
Comments
Hi @saad352, thank you for reporting this issue. Just to confirm, are you experiencing this on the latest version (2.16) as well? |
Hey @mariedm, |
Hi @saad352, thank you for your response. I tested it on my side and can see the |
Hi @mariedm, Below is the the code which I am using in both.
Could there be something else which could be interfering with this in our codebase?
No, we are not making any changes. Just bumping the version. |
With the above new findings that issue is only happening in our codebase, I again checked the changes between |
Hi @saad352, Thank you for the additional information and for debugging on your side, this is very appreciated. Could you enable debug logs to see if any error is reported by the SDK, please? Something else you could try is to set a breakpoint when the |
Hi @mariedm,
Yes, this part is being triggered and I can see the values. Do you think if swizzling of ViewController lifecycle events could be an issue here? |
I don't think swizzling has anything to do with it. The Given that you are not facing this issue with a code sample, it seems to be specific to your app. Without your code, it's difficult for us to investigate further. You might also try filtering actions by type using the search bar with |
Hi @mariedm ,
Commenting that one line out makes the action appear again in Datadog RUM. |
Hi @dcacenabes , @saad352 👋 Thank you very much for investigating further. I would be super helpful if you had a sample project that reproduce the issue, I understand it's a big request but would be quicker for us to troubleshoot. If that's not possible, I would kindly ask if you could do further debugging. Check the app start propagation; make sure the application launch view is properly created by setting breakpoints: I'm interested to know where and why the propagation fails. The fact that it works with a vanilla project suggests that the SDK init flow is different in your prod app. Where do you init the SDK? is it called from the app delegate/SwiftUI.App or later during the app process? Thank you again for your help 🙏 |
Hi @maxep ,
We are initializing the SDK in a call from
We're doing it like this:
On it! 🏃 🕵️ Will share my learnings later.
We are already working on trimming our project to the bare minimum that reproduces the issue, but it is a complex project 🙏 |
@maxep I have made some progress on debugging the issue. Although I have not yet figured out exactly where the error is, I have narrowed it down a lot, so I wanted to share my findings here already in case they can be of help.
When we comment out the code:
Then the action is written to the right directory. |
I can consistently reproduce it with a sample project. You simply need to do this in your App Delegate: func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Datadog.initialize(
with: Datadog.Configuration(
clientToken: "token",
env: "stage",
service: "service-name"
),
trackingConsent: .pending
)
RUM.enable(
with: RUM.Configuration(
applicationID: "app-id",
uiKitViewsPredicate: DefaultUIKitRUMViewsPredicate(),
uiKitActionsPredicate: DefaultUIKitRUMActionsPredicate(),
urlSessionTracking: RUM.Configuration.URLSessionTracking()
)
)
RUMMonitor.shared().addAttribute(forKey: "build", value: "research-app-start")
// This one works
// DispatchQueue.main.async {
// Datadog.set(trackingConsent: .granted)
// }
// This one does not work
Datadog.set(trackingConsent: .granted)
return true
} |
Hey @dcacenabes 👋 That's a very interesting finding, thank you very much 🙏 We have now steps to reproduce and we will investigate further on our side, it looks indeed like an issue of the SDK. I hope this helps. Thank you again for the detailed troubleshooting! |
We're using reactive programming and the tracking consent is being set from a stream, so we can't pass it from the beginning in an easy way. The workaround for us is changing:
to
This workaround is enough to get the application_start submitted to datadog, but this has now unveiled another issue.
|
Hi @dcacenabes, thank you for the thorough investigation and detailed report; it's very helpful. We addressed the race condition in PR #2063, which will be included in our next release. Keep an eye out for the update! |
Describe the bug
Datadog SDK sends action of type
application_start
. This is working fine until the version2.5.1
but this event is not being sent from version2.6.0
onwards.More info
I have scanned and tried to debug through the sdk code. The data for
application_start
seems to be gathered properly and written usingFileWriter
but I don't see data in the RUM Web dashboard. So my guess is that it is being collected but not sent. More over I see this code change to send N batches sequentially. Not sure but could be related to this. My reasoning for pointing to this PR is that we are only missing the first event which isapplication_start
, the rest of the events I see are fine. So may be it is missing the first event and sending the later ones just fine? Or may be something else.Reproduction steps
Use ddsdk version
2.5.1
and we can see the actionapplication_start
but when bumping to2.6.0
the event does not seems to be sent.SDK logs
N/A
Expected behavior
application_start
event should be seen in the RUM dashboard.Affected SDK versions
>= 2.6.0
Latest working SDK version
2.5.1
Did you confirm if the latest SDK version fixes the bug?
Yes, it does not fix the issue.
Integration Methods
Cocoapods
Xcode Version
15.4
Swift Version
swiftlang-5.10.0.13
MacOS Version
No response
Deployment Target
iOS 17
Device Information
All
Other relevant information
No response
The text was updated successfully, but these errors were encountered: