- Mark as New
- Subscribe to RSS Feed
- Permalink
‎04 Sep 2024 08:22 PM - last edited on ‎24 Sep 2024 12:34 PM by MaciejNeumann
I have difficulties finding any info on addressing issues while integrating Dynatrace into an iOS app. So far, after completing the setup wizard I see users & sessions on Dynatrace dashboard but still no records of web requests, crashes and custom actions.
I have some questions to start with:
- since the app is already in production and traffic control is set to, let's say, 10%, how to force a local app run to log the data to Dynatrace? Setting the traffic control to 100% isn't favorable because there are a lot of end users using the app
- currently the console logs contain many warnings of this type:
objc[96868]: Class ObjC is implemented in both .../Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/PrivateFrameworks/VFX.framework/Frameworks/libVFXCore.dylib (0x20ec8e438) and .../DynatraceSessionReplay.framework/DynatraceSessionReplay (0x106ed4b20). One of the two will be used. Which one is undefined.
so, interesting if it actually breaks any functionality of Dynatrace?
- any tips how to figure out missing logs of web requests and custom actions?
Solved! Go to Solution.
- Labels:
-
mobile monitoring
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎05 Sep 2024 07:08 AM
If privacy opt-in is enabled, but no level was set, the agent is in a restricted mode and only sends anonymous data and no data that could contain any PII like user actions:
https://docs.dynatrace.com/docs/shortlink/ios-oneagent-sdk#change-users-data-privacy-preferences
same goes for crashes, they also need to be enabled than - there is a snipped in the wizard that shows an example fo both.
regarding traffic controll, it is advices to have a different environment set up for development to be able to experiment.
the console log does not have any impact - we are aware of it and it will be fixed in the future, but not short term as it requires some design changes.
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎06 Sep 2024 02:21 AM
Thank you for the answers.
I noticed that when initializing Dynatrace.userPrivacyOptions the callback isn't called and the settings aren't applied afterwards. Here's the code:
let privacyConfig = Dynatrace.userPrivacyOptions()
privacyConfig.dataCollectionLevel = .userBehavior
privacyConfig.crashReportingOptedIn = true
privacyConfig.crashReplayOptedIn = true
Dynatrace.applyUserPrivacyOptions(privacyConfig) { (successful) in
assert(successful) // <- this point isn't reachable in result
ConsoleLog("Privacy settings: dataCollectionLevel=\(Dynatrace.userPrivacyOptions().dataCollectionLevel), crashReportingOptedIn=\(Dynatrace.userPrivacyOptions().crashReportingOptedIn), crashReplayOptedIn=\(Dynatrace.userPrivacyOptions().crashReplayOptedIn)")
}
Dynatrace.startupWithInfoPlistSettings()
ConsoleLog("Privacy settings: dataCollectionLevel=\(Dynatrace.userPrivacyOptions().dataCollectionLevel), crashReportingOptedIn=\(Dynatrace.userPrivacyOptions().crashReportingOptedIn), crashReplayOptedIn=\(Dynatrace.userPrivacyOptions().crashReplayOptedIn)")
// The log is: Privacy settings: dataCollectionLevel=DTX_DataCollectionLevel(rawValue: 0), crashReportingOptedIn=false, crashReplayOptedIn=false
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎06 Sep 2024 07:57 AM - edited ‎06 Sep 2024 08:13 AM
As you use Dynatrace.startupWithInfoPlistSettings() I assume you disabled automatic agent start. You should start the agent before you applies the privacy settings, then it should work.
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎06 Sep 2024 06:15 PM
Thanks, it works well after I moved "Dynatrace.startupWithInfoPlistSettings()" up.
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎06 Sep 2024 02:22 AM
And regarding different environments - how to configure Dynatrace to differentiate dev. and prod. environments? In the app we do have dev. and prod. configs already
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎06 Sep 2024 08:11 AM
As you already used manual startup Dynatrace.startupWithInfoPlistSettings() you could switch to Dynatrace.startup(withConfig: startupDictionary) and provide the dev/prod environment config on app start depending on which mode the app is in. See https://docs.dynatrace.com/docs/shortlink/ios-oneagent-sdk#start-oneagent-config-dict
Please be aware that it is not intended to use the Dynatrace.shutdown() API to switch configurations as this will be deprecated. (There will be a better solution to switch environments, but this is
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎06 Sep 2024 06:18 PM
Still I'm confused which attribute determines if the environment is dev. or prod. Or do different environments on Dynatrace side are represented by different app entities (DTXApplicationID)?
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎09 Sep 2024 07:21 AM
Yes, the applicationID determines which Mobile App entity on Dynatrace side the captured data is reported to.
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎10 Sep 2024 08:39 PM
Thank you. Multiple environments work well now. One question regarding crashes - if the traffic control is set to 10%, than only 10% of crashes are recorded as well or all 100% not depending on the traffic control settings?
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎11 Sep 2024 07:05 AM
as traffic controls disables capturing on per-session base this also includes crashes - otherwise this would skew the crash free users metric
- Mark as New
- Subscribe to RSS Feed
- Permalink
‎11 Sep 2024 02:28 PM
Thank you for all your answers. So far all the issues have been resolved