Skip to main content
Version: 25.03

Performance Monitoring - Metric Read

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/metric

Overview​

Returns the aggregated and over-time values of one metric of a trace. The data can be filtered with a query and, on request, split by user attributes.

Authentication​

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

Permissions​

Requires performance_monitoring Read permission.

Request Parameters​

ParameterTypeRequiredDescription
app_idStringYesApplication ID.
typeStringYesTrace type: network or device.
idStringYesTrace ID, as returned in the id field of traces by Overview Read.
metricStringYesName of the metric, for example response_time or duration.
periodString or ArrayYesmonth, day, yesterday, hour, <number>days (for example 30days), or a custom range as a JSON array.
queryJSON String (Object)NoFilter on the samples, in the same format as the Drill queryObject.
bucketStringNohourly, or daily (default). Sets the granularity of overTime.
attributesStringNotrue also returns the data split by user attributes.
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.

Examples​

Read the response time of a network trace​

/o/apm/metric?
app_id=6991c75b024cb89cdc04efd2&
api_key=YOUR_API_KEY&
type=network&
id=TRACE_ID&
metric=response_time&
period=30days

Response​

Success Response​

{
"trace": "example.com/api/items",
"aggregate": {},
"overTime": {},
"attributes": {}
}

Response Fields​

FieldTypeDescription
traceStringName of the trace.
aggregateObjectAggregated value of the metric over the period, with name, id and data. Empty if there is no data.
overTimeObjectValues of the metric per day (or per hour), with name, id and data. Empty if there is no data.
attributesObjectValues of the metric split by user attribute. Only present when attributes is true and the server has Drill.

Error Responses​

  • 400
{
"result": "Unacceptable trace type."
}
  • 400
{
"result": "Trace id not provided."
}
  • 400
{
"result": "Metric not provided."
}
  • 400
{
"result": "Missing request parameter: period"
}
  • 400
{
"result": "Bad request parameter: period"
}
  • 400
{
"result": "Metric data could not be fetched."
}