21 Sep 2023 06:54 PM
Hi All,
I feel this is probably something very simple but im having some issues working out how to do it and i've not seen any answers that help.
In our app we have a number of user actions we track with actions, for example screens being viewed, buttons being clicked etc.
Example of screen view tracking.
val action = Dynatrace.enterAction("Screen view : <app.error_screen>")
action.leaveAction()
I need to be able to view these screen views over a time period similar to this graph, for example when Error screens are being shown, so I can see a graph of the last x days and see when problems have occurred.
Any help is much appreciated.
Thanks
Kev
Solved! Go to Solution.
21 Sep 2023 11:12 PM
Hi @KevThompson,
Please double check it, but it will not meet your requirements exactly, because it gives back the all action count numbers from the affected sessions:
SELECT DATETIME(startTime, 'HH:mm', '5m'), SUM (userActionCount) FROM usersession WHERE useraction.application='your appliacation name' AND useraction.name="your individual user action name" GROUP BY DATETIME(startTime, 'HH:mm', '5m')
So it would be closer, because it gives back the session id count where the specific user action can be found. This is not deal with those cases where the specific action can be found more than one.
SELECT DATETIME(startTime, 'HH:mm', '5m'), COUNT (userSessionId) FROM usersession WHERE useraction.application='your application name'AND useraction.name="your individual user action name" GROUP BY DATETIME(startTime, 'HH:mm', '5m')
I hope it helps.
Best regards,
Mizső
22 Sep 2023 11:50 AM - edited 22 Sep 2023 11:52 AM
Hi Mizső,
Thanks for the feedback, I've tried to use this one but I get the following error, any ideas?
SELECT DATETIME(startTime, '2023-09-01 00:00', '5m'), COUNT (userSessionId) FROM usersession WHERE useraction.application='My3 App ' AND useraction.name="Screen change : app.dashboard" GROUP BY DATETIME(startTime, '2023-09-20 00:00', '5m')
Thanks
Kev
22 Sep 2023 12:03 PM - edited 22 Sep 2023 12:04 PM
Hi @KevThompson,
Try this one, you should cahnge only the app and the user action name. In this case you will have graph and it can pin to dashboard:
SELECT DATETIME(startTime, ''HH:mm', '5m'), COUNT (userSessionId) FROM usersession WHERE useraction.application='My3 App ' AND useraction.name="Screen change : app.dashboard" GROUP BY DATETIME(startTime, ''HH:mm', '5m').
I have not tried it but check to create custom metric (for alerting) and change to graph to single value (maybe it would be better on dashboard with time filter).
Best regards,
Mizső
22 Sep 2023 12:43 PM
Excellent thank you Mizső, its working now, the confusion point was I thought you had to put the required date ranges into the DateTime in the query, where as that comes form the timeframe selector.
We have recently moved from another provider which also had its own QL so a few confusing cross over points.
Thanks
Kev
22 Sep 2023 01:10 PM
Your welcome! 😉