• Forums
    • Public Forums
      • Community Connect
      • Dynatrace
        • Dynatrace Open Q&A
      • Application Monitoring & UEM
        • AppMon & UEM Open Q&A
      • Network Application Monitoring
        • NAM Open Q&A
  • Home /
  • Public Forums /
  • Dynatrace /
  • Dynatrace Open Q&A /
avatar image
Question by Robert A. · May 01, 2019 at 04:20 PM · user session monitoring user actions

User Session\Action API Get User count for application

I am trying to use the API to get real user counts per application. I have tried the following but it isn't matching what the console is showing. Can someone shed some light on this? It seems I am getting a fraction of the userids and some of the ones that are anon it is returning those as 'null'

select usersession.userid FROM usersession where usersession.userType = 'REAL_USER' AND useraction.application = 'My Awesome Application' GROUP BY usersession.userid

Comment

People who like this

0 Show 0
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

2 Replies

  • Sort: 
  • Most voted
  • Newest
  • Oldest
avatar image
Best Answer

Answer by Robert A. · May 01, 2019 at 06:59 PM

Yep I found where you can set this: The framework always applies an upper limit to prevent system overload. If LIMIT is not used, 50 results are returned by default.

Comment

People who like this

0 Show 0 · Share
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

avatar image

Answer by Robert A. · May 01, 2019 at 04:36 PM

It looks like the API is capping at 50 rows.

Comment

People who like this

0 Show 9 · Share
10 |2000000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Toggle Comment visibility. Current Visibility: Viewable by all users

Up to 10 attachments (including images) can be used with a maximum of 50.0 MiB each and 250.0 MiB total.

avatar image Joshua P. · May 01, 2019 at 07:34 PM 0
Share

I believe from my testing the maximum rows that can be returned is 5000. So, adding a "LIMIT 5000" to the end of the USQL request would be required.

Kind regards,
Joshua Pavlica

avatar image Robert A. Joshua P. · May 01, 2019 at 07:38 PM 0
Share

Yes I was able to get it to return the data although if I tell it to give me the count of userids in the query, the number doesn't match the user count from the User session console. I am thinking I don't have a filter or it is ignoring the timeframe filter because each time I run the query the number changes.

Query I am trying:

startTimestamp=1556733966561&endTimestamp=1556737361768&query=select count(userid) FROM usersession where usersession.userType = 'REAL_USER' AND useraction.application = 'My Awesome App' LIMIT 5000

avatar image Joshua P. Robert A. · May 01, 2019 at 07:40 PM 0
Share

Hey Robert!

The USQL and User Sessions API only work for completed/finished sessions, whereas the in-UI User Sessions page will also show "Live"/in-progress sessions.

If your timestamp is recent enough, this could be the reason why you are seeing differences.

Kind regards,
Joshua Pavlica

avatar image Robert A. Joshua P. · May 01, 2019 at 08:04 PM 0
Share

Yes, I set the startime to be 0 so that it will give me the last 2 hours and I changed the UI to show me the last 2 hours? I am trying to get the unique users that have access my website in the last hour. The same data that shows up when I click on the User Sessions in the UI. You are saying though that the API will only give me the completed correct? I am just trying to get a count of how many users have been to my website in the last 2 hours. So this would be the count of users that have completed sessions and current live users.

avatar image Joshua P. Robert A. · May 01, 2019 at 08:34 PM 1
Share

Live sessions are most commonly seen during the last 2 hours, so that is correct that the USQL results will be different by only having the completed sessions displayed.

Kind regards,
Joshua Pavlica

avatar image Robert A. Joshua P. · May 01, 2019 at 08:43 PM 0
Share

Is there any way in the API to get live session data? If I am only counting completed sessions, I am not really getting the true count of users that have been or are still on the website in the last 2 hours. The UI gives me this information.

avatar image Joshua P. Robert A. · May 01, 2019 at 09:00 PM 1
Share

Not using the USQL API, no. There is an upcoming improvement in the next quarter or so to include a "user count" for Web Applications via the Timeseries API. This might help with your use-case.

Kind regards,
Joshua Pavlica

avatar image Robert A. Joshua P. · May 01, 2019 at 09:20 PM 0
Share

Thank you for that information! What I probably will end up doing is just checking the numbers once a day at a time when there shouldn't be much traffic on the website. That at least will give me a good ball park of users that used the system during the day.

avatar image Joshua P. Robert A. · May 01, 2019 at 09:21 PM 0
Share

You're very welcome, Robert!
And sounds good!

Kind regards,
Joshua Pavlica

How to get started

First steps in the forum
Read Community User Guide
Best practices of using forum

NAM 2019 SP5 is available


Check the RHEL support added in the latest NAM service pack.

Learn more

LIVE WEBINAR

"Performance Clinic - Monitoring as a Self Service with Dynatrace"


JANUARY 15, 3:00 PM GMT / 10:00 AM ET

Register here

Follow this Question

Answers Answers and Comments

29 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Best way to meassure people using an application

How to exclude specific load action in User Sessions?

user action mobile app

Reports and concurrents user

How often is the user session data sent to Elasticsearch?

Forum Tags

mobile monitoring dotnet iis chat kubernetes servicenow amazon web services feedback mysql mainframe application rules rest api cassandra dashboard oneagent sdk cmc application monitoring openkit smartscape request attributes monitoring developer community user tagging log monitoring services ufo activegate auto-detection high five award uem webserver usql iib test automation license ios news migration management zones ibm mq web services notifications sso host monitoring knowledge sharing reports browser monitors java hybris sap vmware maintenance window user action naming javascript appmon ai availability tipstricks automation extensions diagnostic tools session replay permissions search davis assistant auto-update faq documentation problem detection http monitors easytravel apdex network docker tags and metadata cloud foundry google cloud platform synthetic monitoring process groups account usability dynatrace saas gui paas openshift key user actions administration production user actions postgresql synthetic locations upgrade oneagent security Dynatrace Managed user management python technologies mongodb openstack user session monitoring continuous delivery citrix configuration alerting performance monitoring NGINX action naming linux nam installation error reporting database mission control apache mobileapp RUM php azure purepath davis scripting aix nodejs android
  • Forums
  • Public Forums
    • Community Connect
    • Dynatrace
      • Dynatrace Open Q&A
    • Application Monitoring & UEM
      • AppMon & UEM Open Q&A
    • Network Application Monitoring
      • NAM Open Q&A