Skip to main content
Version: 24.05

Performance Monitoring - User Samples

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint​

/o/apm/user-samples

Overview​

Returns a page of the network or device trace samples reported by one user.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

  • Requires Read permission for the Performance Monitoring feature (performance_monitoring) in the target app.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesID of the app.
uidStringYesID of the app user.
typeStringYesTrace type, network or device.
sSearchStringNoOnly return samples whose trace name matches this text (case-insensitive).
iSortCol_0NumberNoColumn to sort by: 1 trace name, 2 start time (default), 3 end time.
sSortDir_0StringNoasc for ascending; any other value or none sorts descending.
iDisplayStartNumberNoNumber of samples to skip. Defaults to 0.
iDisplayLengthNumberNoNumber of samples to return. Defaults to 5.
sEchoStringNoValue echoed back in the response, for DataTables paging.

Examples​

Example: Read the network samples of a user​

curl "https://your-server.com/o/apm/user-samples?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&uid=USER_ID&type=network"

Response​

Success Response​

{
"sEcho": "1",
"iTotalRecords": 1,
"iTotalDisplayRecords": 1,
"aaData": [
{
"_id": "SAMPLE_ID",
"uid": "USER_ID",
"did": "DEVICE_ID",
"ts": 1649323200000,
"sg": {
"name": "example.com/demo/",
"apm_metrics": "{\"response_time\":106}",
"stz": 1649323200000,
"etz": 1649323200106
}
}
]
}

Response Fields​

FieldTypeDescription
sEchoStringThe sEcho value of the request.
iTotalRecordsNumberTotal number of samples of the user.
iTotalDisplayRecordsNumberSame as iTotalRecords.
aaDataArrayThe samples of the requested page. Each has the user (uid), device (did), time (ts) and the trace data (sg: name, apm_metrics, stz, etz).

Error Responses​

  • HTTP 400 - Invalid request:
{
"result": "Please provide user uid."
}

Other messages for HTTP 400: Please provide APM type. and Something went wrong..

Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
Drill events collection of the trace typeSamplesReads the samples of the user.