Skip to main content
Version: 24.05

Performance Monitoring - Edit

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​

/i/apm/edit

Overview​

Sets the issue threshold, in seconds, of an existing network or device trace.

Authentication​

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

Permissions​

  • Requires Update permission for the Performance Monitoring feature (performance_monitoring) in the target app, or app admin access to that app. Global admins always have access.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesID of the app the trace belongs to. The app must exist.
idStringYesTrace ID, as returned in the id field of the traces listed by the Performance Monitoring read endpoints (/o/apm/...)
typeStringYesTrace type: network or device. Must match the type of the trace.
thresholdNumberYesNew threshold in seconds. Must be a number greater than or equal to 0; use a whole number of seconds. Trace samples slower than the threshold are reported as issues. New traces start with a threshold of 2.

Examples​

Example: Set a threshold​

curl "https://your-server.com/i/apm/edit?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&id=TRACE_ID&type=network&threshold=3"

Response​

Success Response​

{
"result": "Issue updated"
}

Response Fields​

FieldTypeDescription
resultStringOperation status

Error Responses​

  • HTTP 400 - Invalid trace type:
{
"result": "Unacceptable trace type"
}
  • HTTP 400 - Missing or invalid trace ID:
{
"result": "APM id not provided"
}
  • HTTP 400 - Invalid threshold:
{
"result": "Threshold should be a number greater than equal to 0"
}
  • HTTP 400 - Update failed:
{
"result": "Issue not updated"
}
  • HTTP 400 - Missing auth params:
{
"result": "Missing parameter \"api_key\" or \"auth_token\""
}
  • HTTP 401 - Auth/user validation failed:
{
"result": "User does not exist"
}
  • HTTP 401 - Missing app_id (users who are not global admins):
{
"result": "No app_id provided"
}
  • HTTP 401 - User lacks permission for this app:
{
"result": "User does not have right"
}
  • HTTP 401 - App not found:
{
"result": "App does not exist"
}

Behavior​

  1. Validates the user's update permission for Performance Monitoring in the app.
  2. Checks type, decodes id and checks threshold.
  3. Sets threshold on the trace's properties document.
  4. Writes an apm_edited system log entry with the previous trace properties and the change.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.apmTrace propertiesSets threshold on the trace's properties document.