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

How to get custom values reported by Mobile app in metrics api

ajkinetic
Visitor

I am creating a custom action in my Swift (MOBILE) App as described in the documentation : 

 

let myAction = DTXAction.enter(withName: "My action")

myAction?.reportValue(withName: "My int value", intValue: 1234)

myAction?.reportValue(withName: "My double value", doubleValue: 12.34)

myAction?.reportValue(withName: "My string value", stringValue: "Hello World!")

myAction?.leave()

 

My question is: How do I get the values that have been reported above within Dynatrace, as well as via your API?

 

I can see the Action called "My action" within the dashboard, and I can get metrics from the action by making it a Key User Action, but I cannot seem to get the values for that action: e.g. "My int value" etc.

 

Please help

 

 

 

2 REPLIES 2

Fin_Ubels
Dynatrace Champion
Dynatrace Champion

Hey ajkinetic,

I've set something up in my own environment to hopefully show you a couple of ways you could get these values. Firstly the reported values can only be found within the waterfall analysis for the action unless you configure your environment further. 

 

So firstly to see these values and make sure they are in fact making their way into your environment find your action in a user session and then click the dropdown for it and then go to the waterfall analysis.

Fin_Ubels_0-1647391603231.png

Once in the waterfall analysis all reported values should show up here underneath the action timeline.

Fin_Ubels_1-1647391610085.png

 

 

Now if you want these values to be accessible from the user session query feature or through the API you need to define it as an action property or session property.

Fin_Ubels_3-1647391902043.png

In my example above I have a property called Location, in your example you would set the "Name" field to be "My string value" or "My int value" as that is the name you gave your values in your code. The property details like the key are for viewing and getting the values in Dynatrace which you will see below.


After setting the properties generate some new traffic and then you can check that it worked in the user session query.

Fin_Ubels_4-1647392172989.png

SELECT usersession.userSessionId, usersession.userId, useraction.name, useraction.stringProperties.location FROM useraction WHERE useraction.stringProperties.location IS NOT NULL

The above is an example of the query I used to see my location property being reported.

Hopefully this helps to get your started!

ajkinetic
Visitor

@Fin_Ubels thank you, this is what I was looking for.

Featured Posts