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

Is there a way to retrieve more than 1000 users using Dynatrace API's usersession endpoint?

dparkar
Contributor

We are using the following query to get names of all the users:

SELECT distinct(userid) FROM usersession where useraction.application='<ApplicationName>' GROUP BY userid

However only 1000 users are retrieved.

Is there a way to retrieve all the users at once or if not possible are there means to retrieve all users in small batches and iterating until the last user is fetched?

PS: Tried using LIMIT at the end of the query.

Using Limit 10 or Limit 100 or Limit 500 works and only that many users are fetched

Using LIMIT 1000 or more doesnt work.

There is a limit of 1000 users(rows) in the json response


6 REPLIES 6

trevor_masseng1
Dynatrace Pro
Dynatrace Pro

The API has certain limitations built in to protect the Dynatrace Cluster from experiencing any performance degradation from requests that are too large.
To get around this, my suggestion would be to use regex to pull users who's user id start with a particular character, then do this iteratively for each character that is allowed by the app (a-z, 0-9).

This should break the response up into smaller chunks.
Another option would be to add more specific criteria to your API call if there is a certain type of user or activity that you are looking for.
If neither of these suggestions work for you, feel free to submit an RFE to allow for a larger amount of rows to be returned.


But DQL doesn't support functions like CONTAINS, LIKE, STARTSWITH etc. so that I would have iterated using the first names.


Okay the below query helps.

SELECT distinct(userid) FROM usersession where useraction.application='OMK' and userid startswith 'A' GROUP BY userid limit 1000

Used limit 1000 to get more than 50 rows.

Thanks for your answer 🙂


dominik_stadler
Dynatrace Pro
Dynatrace Pro

With version 1.159 we increased this limit to 5000.


Hi Dominik,


Thanks for your response.

We are using version 1.164


Has this limit changed now?