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
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.
@mark_bley this is not the desired value. The dashboard tile shows active users. The USQL will show results from finished sessions only. That’s a different value and it will never match.
That is correct, then maybe the metrics you are looking for could be builtin:apps.other.userCount.osAndVersion-std or builtin:apps.other.userCount.osAndGeo
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.
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.
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 :face_with_monocle: regrading which metric holds the information that Live user activity tile shows
I am afraid at the moment there is no way to recreate that exact metric since there is no dimension (or USQL parameter) to filter out live sessions. See here for more information