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

OneAgent for iOS - DTXAxtion returning nil

OliverBrownNext
Newcomer

I'm adding OneAgent to a new iOS app. I'm trying to add custom actions but DTXAction.enter is nearly always returning nil.

I found this post with a similar issue https://community.dynatrace.com/t5/Real-User-Monitoring/OneAgent-SDK-for-iOS-DTXAction-enter-returns... that seemed to be caused by the app not having access to the beacon URL. I don't believe that is the cause.

As far as I can see the privacy options are set up to be permissive, and I can see the sessions in the session browser, albeit mostly without my custom action.

The bit that most confuses me is a few times I've seen the action isn't nil, and I do see a few sessions with the events.

I tried getting the result of Dynatrace.lastErrorMsg() but it is always nil. Is there any other way of finding out what, if any, error is happening to cause this?

Thanks,
Oliver

3 REPLIES 3

Julius_Loman
DynaMight Legend
DynaMight Legend

Can you turn on logging and share the app logs? See https://docs.dynatrace.com/docs/shortlink/ios-logging 

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

Thanks for your reply.

After going through a process of enabled the logs, changing the log level, adding my own logging, and getting inconsistent results in the process, I arrived at it seemingly working correctly. I'm 90% I didn't actually change anything meaningful.

One thing I will share is I did get a log export for a time when it failed, and there did not seem to be anything from Dynatrace in it.

In the log below, there was a bunch of output from DTXAutoInstrument. Then one log from me right before attempting to create DTXAction followed immediately my log when the result was null. Then a bunch of output from DTXSwapper.

*️⃣ ALL ♻️ Lifecycle [Agent-DTXAutoInstrument.m:16-259-main] viewDidAppear_DTX: => calling receiver:<0x1028e6600, _TtGC7SwiftUI32NavigationStackHostingControllerVS_7AnyView_> super_class:UIViewController action:viewDidAppear:
*️⃣ ALL ♻️ Lifecycle [Agent-DTXAutoInstrument.m:16-259-main] otherViews_BLOCK -> exited hookedClass:UIViewController hookedSelectorName:viewDidAppear: viewLifecycle:3
DTXAction Timer.Homepage.HomepageLoad.FullyLoaded
DTXAction Timer.Homepage.HomepageLoad.FullyLoaded was nil:
*️⃣ ALL 🎣 Hooks [Agent-DTXSwapper.m:16-259-main] demangling: _TtC4NukeP33_27F0B4BA90823100ED6CA18C21E1B9DD11_DataLoader => Nuke._DataLoader
*️⃣ ALL 🎣 Hooks [Agent-DTXSwapper.m:16-259-main] generics name cleanup: Nuke._DataLoader => Nuke._DataLoader

It's hard to diagnose the issue with just a fraction of the log. If you still have an issue please raise a support ticket and provide the full log when the issue happens.

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

Featured Posts