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
Updatepermission 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
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes (or auth_token) | API key authentication |
auth_token | String | Yes (or api_key) | Auth token authentication |
app_id | String | Yes | ID of the app the trace belongs to. The app must exist. |
id | String | Yes | Trace ID, as returned in the id field of the traces listed by the Performance Monitoring read endpoints (/o/apm/...) |
type | String | Yes | Trace type: network or device. Must match the type of the trace. |
threshold | Number | Yes | New 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
| Field | Type | Description |
|---|---|---|
result | String | Operation 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
- Validates the user's update permission for Performance Monitoring in the app.
- Checks
type, decodesidand checksthreshold. - Sets
thresholdon the trace's properties document. - Writes an
apm_editedsystem log entry with the previous trace properties and the change.
Related Endpoints
Implementation details
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.apm | Trace properties | Sets threshold on the trace's properties document. |