cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Not working Dynatrace features for iOS app

volivan
Visitor

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?

11 REPLIES 11

Patrick_H
Dynatrace Leader
Dynatrace Leader

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.

iOS help: https://www.dynatrace.com/support/help/shortlink/ios-hub

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

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.

iOS help: https://www.dynatrace.com/support/help/shortlink/ios-hub

Thanks, it works well after I moved "Dynatrace.startupWithInfoPlistSettings()" up.

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

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

iOS help: https://www.dynatrace.com/support/help/shortlink/ios-hub

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)?

Yes, the applicationID determines which Mobile App entity on Dynatrace side the captured data is reported to.

iOS help: https://www.dynatrace.com/support/help/shortlink/ios-hub

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?

as traffic controls disables capturing on per-session base this also includes crashes - otherwise this would skew the crash free users metric

iOS help: https://www.dynatrace.com/support/help/shortlink/ios-hub

Thank you for all your answers. So far all the issues have been resolved

Featured Posts