POST /monitors
Changed onCreates a monitor. Axiom runs the monitor's query once before saving it and rejects the request if the query fails, for example because it's invalid or references a dataset that doesn't exist. labelIds replaces assignments when supplied; [] clears them. Omitted or null labelIds preserves assignments on updates and creates an unlabeled resource on creation. IDs must belong to existing labels in your organization and are validated before saving.
Request
- Base URLhttps://api.axiom.co/v2
- AuthOAuth 2Authorization codehttps://accounts.google.com/o/oauth2/v2/authToken URLhttps://www.googleapis.com/oauth2/v4/tokenScopesmonitors|create
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Request body
Example request
{
"alertOnNoData": true,
"aplQuery": "| where severity = 'error' | count() > 100",
"columnName": "cpu_usage",
"compareDays": 7,
"description": "Monitors CPU usage and alerts when it exceeds 90%",
"disabledUntil": "2024-04-01T00:00:00Z",
"intervalMinutes": 5,
"mplQuery": "test-metrics:http_request_duration_seconds",
"name": "Production CPU Monitor",
"notifierIds": [
"z0NfJw64aKagPOBBIJ"
],
"operator": "Above",
"rangeMinutes": 5,
"resolvable": true,
"secondDelay": 300,
"threshold": 90,
"tolerance": 10,
"triggerAfterNPositiveResults": 3,
"triggerFromNRuns": 3,
"type": "Threshold"
}Response
Created monitor.
Example response
{
"alertOnNoData": true,
"aplQuery": "| where severity = 'error' | count() > 100",
"columnName": "cpu_usage",
"compareDays": 7,
"description": "Monitors CPU usage and alerts when it exceeds 90%",
"disabledUntil": "2024-04-01T00:00:00Z",
"intervalMinutes": 5,
"mplQuery": "test-metrics:http_request_duration_seconds",
"name": "Production CPU Monitor",
"notifierIds": [
"z0NfJw64aKagPOBBIJ"
],
"operator": "Above",
"rangeMinutes": 5,
"resolvable": true,
"secondDelay": 300,
"threshold": 90,
"tolerance": 10,
"triggerAfterNPositiveResults": 3,
"triggerFromNRuns": 3,
"type": "Threshold",
"createdAt": "2024-03-20T10:00:00Z",
"createdBy": "usr_789xyz",
"datasets": [
"production-logs"
],
"id": "QgOLFXIvK0ZbYf3tZE",
"updatedAt": "2024-03-20T10:30:00Z"
}Changes
- breaking
removed the enum value
NewValuesof the request property//// - warning
removed the request property
//// - warning
removed the optional property
////from the response with the status - info
removed the
NewValuesenum value from the////response property for the response status
- breaking
- breaking
added
subschema #2to the request bodyallOflist - breaking
the request's body type changed from
objectto no type - warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
removed the request property
- warning
added the new
NewValuesenum value to the////response property for the response status - info
added the optional property
////to the response with the status - info
added the optional property
////to the response with the status - info
added the optional property
/to the response with the status - info
added the required property
/to the response with the status
- breaking