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

USQL a userAction's timeseries graph

KevThompson
Visitor

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.

KevThompson_0-1695318410044.png

 

Any help is much appreciated.

 

Thanks

Kev

5 REPLIES 5

Mizső
DynaMight Leader
DynaMight Leader

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ő

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

KevThompson
Visitor

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')

 

KevThompson_2-1695379706739.png

Thanks

Kev

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ő

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

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

Your welcome! 😉:dynaspin:

Dynatrace Community RockStar 2024, Certified Dynatrace Professional

Featured Posts