Customer ask to put the number of current users of a mobile app on the data explorer tile in order to give it some nice colors and size it to fit a NOC dashboard but we didn't find anywhere a metric for that...
The information is shown in the Mobile infographic
And in Mobile tile
But we could not find this information in any metric.
Can you guys help and explain where is this missing metric!?
All the best and stay safe
Solved! Go to Solution.
you can define such a tile for a dashboard using USQL, for the user with e.g.:
select count(*) as "Users" from usersession
You can run that under User sessions > User sessions query and once you are happy with the result on that page you will be able to pin the result to a dashboard.
Unfortunately, no values of those metrics do not match the value on the infographic and dashboard tile. I get 3x the value from the metric compared to the value on the infographic.
There is no clear answer hear as Dynatrace does not actually expose the live sessions, it is 'in memory' only and the values you see on the application and user sessions screen under 'live' are not retrievable via usql or metrics.
There are 2 options,
1. As mentioned above, use usql
This is going to have to be delayed data (e.g what happened last hour) based on the completion of user sessions, so will never be entirely accurate for what you want, since it's only going to give you closed sessions.
example queries below.
SELECT count(distinct UserId) as 'Current Unique UserID' FROM usersession
Where useraction.application IN ("xxx") and userId IS NOT NULL
SELECT count(distinct UserId) as 'Sessions with Errors' FROM usersession
Where useraction.application IN ("xxx") and userId IS NOT NULL and useraction.requestErrorCount > 0
2. The better alternative is to use the inbuilt calculated metrics
These will give you Dynatrace pre calculated 'estimated' number of active users and sessions. it is split between mobile & web, so you might need to show this data separately.
Anyway, good luck
@Peter_Ralston I don't think the value is "in memory only", since it's not the actual value. If you change the time frame, the value changes.
For illustration this is a sample dashboard in the Demo environment (link😞
Time frame is set to yesterday in the screenshot. You can see the metrics mentioned above by @mark_bley have the same value (expected). It's roughly the count of user session using USQL (expected). The number of users is higher (third metric).
However, you can see a significant difference between the mobile app tile value and other values. For days before yesterday, I can see an even bigger difference (4.8k vs 12k).
@Yosi_Neuman were you able to find the source? I start suspecting the value in the tile and infographic is wrong.
IMO /rest/startscreen/data/MOBILE_APPLICATION is looking as the "The Usual Suspects" here.
The queries used are:
Ok, yes. I focused on the sessions metrics. I agree this is finally the same metric as in the tile.
Still curious how the metric (builtin:apps.other.userCount.osAndVersion-std) is calculated as it seems it does not match the count of users using USQL or sessions.
Thank you @mark_bley & @Julius_Loman for helping out and find the way to show the number of mobile users as shown in mobile application and tile from a metric, but your answer Mark raised another question regrading which metric holds the information that Live user activity tile shows
And when drill down into this tile and split them by application is shows the live session
Is there a metric that holds this information too that we can put on a dashboard?
Thanks in advance
All the best and stay safe