Axiom Alerting
You manage alerting in Axiom end-to-end: notifiers for routing and monitors for detection.
API Overview
Base URL: https://api.axiom.co/v2/ with Bearer token auth from .axiom.toml (project root or ~/.axiom.toml).
Monitors (/v2/monitors)
| Operation | Method | Path |
|---|---|---|
| List | GET | /v2/monitors |
| Get | GET | /v2/monitors/{id} |
| History | GET | /v2/monitors/{id}/history |
| Create | POST | /v2/monitors |
| Update | PUT | /v2/monitors/{id} |
| Delete | DELETE | /v2/monitors/{id} |
Notifiers (/v2/notifiers)
| Operation | Method | Path |
|---|---|---|
| List | GET | /v2/notifiers |
| Get | GET | /v2/notifiers/{id} |
| Create | POST | /v2/notifiers |
| Update | PUT | /v2/notifiers/{id} |
| Delete | DELETE | /v2/notifiers/{id} |
Prerequisites
- Run
scripts/setup - Ensure
.axiom.tomlhas a deployment:
[deployments.prod]
url = "https://api.axiom.co"
token = "xaat-your-token"
org_id = "your-org-id"Scripts
Core:
scripts/axiom-api <deploy> <method> <path> [body]
Monitor scripts:
scripts/monitor-list <deployment> [--json]scripts/monitor-get <deployment> <id>scripts/monitor-history <deployment> <id> <startTime> <endTime>scripts/monitor-create <deployment> <json-file>scripts/monitor-update <deployment> <id> <json-file>scripts/monitor-delete <deployment> <id>
Notifier scripts:
scripts/notifier-list <deployment> [--json]scripts/notifier-get <deployment> <id>scripts/notifier-create <deployment> <json-file>scripts/notifier-update <deployment> <id> <json-file>scripts/notifier-delete <deployment> <id>
Recommended Workflow
- Create notifier first.
- Create monitor and set
notifierIds. - Validate monitor behavior with
monitor-history. - Iterate monitor thresholds and schedule.
Workflow: End-To-End Alerting
- Run
scripts/setup. - List existing notifiers with
scripts/notifier-list <deployment>and reuse one if appropriate. - If no suitable notifier exists, create one with
scripts/notifier-create. - Create or update the monitor with
notifierIdsattached. - Validate with
scripts/monitor-history <deployment> <id> <startTime> <endTime>. - If behavior is noisy or silent, tune
threshold,rangeMinutes,intervalMinutes, and N-of-M trigger fields. ForMatchEventandNewValuesmonitors, tune the query instead: they have no threshold or trigger fields. - Re-check history after each change.
Best Practices
- Configure one channel per notifier.
- Use
emails(notrecipients) for email notifier payloads. - Prefer
triggerAfterNPositiveResults/triggerFromNRunsfor noisy signals. - Use explicit
bin()in monitor queries; avoidbin_auto()for alert logic. - For metrics-backed monitors, prefer
mplQueryfor definitions; API responses may include bothaplQueryandmplQuery.
Monitor Types And Operators
Choose the type by what should alert:
Threshold: an aggregated value crosses a fixed number. Good for error counts, latency percentiles, and queue depth.MatchEvent: every event that matches a filter. Good for events that each need attention, such as a failed deploy, a panic, or a change to a production secret.NewValues: a column of the query results holds a value it has not held recently. Good for first appearances. Without an aggregation, any first sighting: a new error message, host, or AWS API call. With an aggregation, a new value that passes a bar: a new API client that sends at least 200 requests in an hour.AnomalyDetection: a time series moves away from its own recent behavior. Good for values with no obvious fixed limit, such as traffic or ingest volume that suddenly drops or spikes.
Query rules:
Threshold: an APL query must aggregate (summarize).mplQueryis supported.MatchEvent: APL only. The query cannot aggregate, and it can use onlywhere,project(andproject-away,project-keep,project-rename,project-reorder),extend,extend-valid,parse,parse-kv,union,lookup, andredact.NewValues: APL only. The query can filter, project, and aggregate.AnomalyDetection: the query must return a time series (summarize ... by bin(_time, ...)) with at least 11 points per group.mplQueryis supported.
Operators:
Threshold:Above,AboveOrEqual,Below, orBelowOrEqual.AnomalyDetection:Above,Below, orAboveOrBelow.MatchEventandNewValues: none. Do not setoperatoron aNewValuesmonitor.
Alerting:
ThresholdandAnomalyDetectionopen an alert on a breach and close it on the first run without one. Notifiers hear about both.MatchEventandNewValueshave no alert to open or close. Each matching event or new value sends its own notification, at most 9 per run, and nothing is sent when it stops appearing.
Monitor Field Reference
Core fields:
name: Human-readable monitor name.type:Threshold,MatchEvent,NewValues, orAnomalyDetection.aplQuery/mplQuery: Query evaluated by the monitor.notifierIds: Array of notifier IDs to notify.disabled: Whether monitor is disabled.disabledUntil: Optional timestamp for temporary disable/snooze.description: Optional monitor description.
Schedule fields:
intervalMinutes: Evaluation cadence in minutes.rangeMinutes: Query evaluation window in minutes.MatchEventmonitors always run every minute over the last minute: send 1 for both fields, because other values are ignored. On aNewValuesmonitor,rangeMinutescannot be less thanintervalMinutes.secondDelay: Seconds to move the whole window into the past, so that late-arriving data is included.
Threshold and anomaly fields (Threshold and AnomalyDetection only):
operator: Comparison operator.threshold: Numeric threshold value (Threshold).tolerance: Required forAnomalyDetection. The last point breaches when it is more than this many standard deviations from the mean of the earlier points. Above 0, usually 2 to 5; lower values alert more often.compareDays: Optional forAnomalyDetection. First subtracts, point by point, the same window this many days earlier.alertOnNoData: Whether no-data should trigger alerting.triggerAfterNPositiveResults: Positive evaluations required before firing.triggerFromNRuns: Total evaluation runs considered for N-of-M logic.
Advanced behavior fields:
resolvable: Whether alerts can resolve automatically.notifyByGroup: Notify per group key/value result.notifyEveryRun: Notify on every positive evaluation.skipResolved: Skip sending resolved notifications.
New values fields (NewValues only):
trackedValue: Required. The name of the column of the query results to watch. It cannot be the result of an aggregation, such ascount().lookbackDays: Required, at least 1. A value is new when the column has not held it for this many days.backfillDays: Optional, 0 tolookbackDays. Records the values the query returns over this many previous days as already seen before the first run. With 0, the first run that returns values records them and does not alert. Use 0 when the query aggregates: the backfill runs the query once over the whole period, not once perrangeMinutes, so a bar such aswhere requests >= 200is applied to totals for the whole period.- Changing
aplQuery,trackedValue,intervalMinutes,rangeMinutes, orsecondDelayon an existing monitor clears the values it has recorded, and it learns again. Changes tolookbackDayskeep them. - Limits: fewer than 50,000 distinct values in the column within
lookbackDays, and at most 1,000 new values in one run. A monitor that exceeds a limit fails its runs.
Minimal Valid Monitor Examples
Threshold:
{
"name": "High Error Count",
"type": "Threshold",
"aplQuery": "['logs'] | where status >= 500 | summarize count()",
"operator": "Above",
"threshold": 100,
"rangeMinutes": 5,
"intervalMinutes": 5,
"notifierIds": ["notifier-id"],
"triggerAfterNPositiveResults": 2,
"triggerFromNRuns": 3,
"disabled": false
}MatchEvent:
{
"name": "Error Event Match",
"type": "MatchEvent",
"aplQuery": "['logs'] | where level == 'error'",
"rangeMinutes": 1,
"intervalMinutes": 1,
"notifierIds": ["notifier-id"],
"disabled": false
}NewValues, any first sighting:
{
"name": "New Error Message",
"type": "NewValues",
"aplQuery": "['logs'] | where level == 'error' | project message",
"trackedValue": "message",
"lookbackDays": 30,
"backfillDays": 7,
"rangeMinutes": 5,
"intervalMinutes": 5,
"notifierIds": ["notifier-id"],
"disabled": false
}NewValues with an aggregation, a new value that passes a bar. This one checks the last hour every 5 minutes:
{
"name": "New API Client",
"type": "NewValues",
"aplQuery": "['http-logs'] | summarize requests = count() by client | where requests >= 200",
"trackedValue": "client",
"lookbackDays": 90,
"backfillDays": 0,
"rangeMinutes": 60,
"intervalMinutes": 5,
"notifierIds": ["notifier-id"],
"disabled": false
}AnomalyDetection:
{
"name": "Request Volume Anomaly",
"type": "AnomalyDetection",
"aplQuery": "['http-logs'] | summarize count() by bin(_time, 5m)",
"operator": "AboveOrBelow",
"tolerance": 3,
"rangeMinutes": 120,
"intervalMinutes": 5,
"notifierIds": ["notifier-id"],
"disabled": false
}Minimal Valid Notifier Examples
Email:
{
"name": "Oncall Email",
"properties": {
"email": {
"emails": ["oncall@example.com"]
}
}
}Slack:
{
"name": "Oncall Slack",
"properties": {
"slack": {
"slackUrl": "https://hooks.slack.com/services/T.../B.../XXX"
}
}
}Custom webhook:
{
"name": "Oncall Custom Webhook",
"properties": {
"customWebhook": {
"url": "https://api.example.com/alerts",
"body": "{\"action\":\"{{.Action}}\",\"monitorID\":\"{{.MonitorID}}\"}"
}
}
}Troubleshooting
401 Unauthorized:
- Cause: invalid or expired token.
- Fix:
- Verify token in
~/.axiom.toml. - Re-run
scripts/setupand retry:scripts/notifier-list <deployment>
- Verify token in
403 Forbidden:
- Cause: token lacks required permissions.
- Fix:
- Create/assign token scopes for monitor/notifier management and dataset query access.
- Retry:
scripts/monitor-list <deployment>
404 Not Found on get/update/delete:
- Cause: wrong monitor/notifier ID or wrong deployment/org.
- Fix:
- Confirm deployment in
.axiom.toml. - Re-list objects and use exact IDs:
scripts/monitor-list <deployment> --jsonscripts/notifier-list <deployment> --json
- Confirm deployment in
400 Bad Request on notifier create/update:
- Cause: invalid notifier payload shape.
- Fix:
- Use one notifier channel inside
properties. - For email, use
emails(notrecipients). - Validate against a known-good example and retry:
scripts/notifier-create <deployment> <json-file>
- Use one notifier channel inside
400 Bad Request on monitor create/update:
- Cause: invalid monitor schema, operator/type mismatch, or invalid query fields.
- Fix:
- Validate required fields:
name,type, query field, schedule, andnotifierIds. - Confirm
operatormatches monitor type and threshold logic. must set Tolerance: anAnomalyDetectionmonitor needstolerance.must set NewValuesLookbackDays: aNewValuesmonitor needslookbackDays.RangeMinutes must not be less than IntervalMinutes: raiserangeMinuteson theNewValuesmonitor.cannot set [Operator Tolerance CompareDays]: remove those fields from theNewValuesmonitor.- Retry:
scripts/monitor-create <deployment> <json-file>scripts/monitor-update <deployment> <id> <json-file>
- Validate required fields:
Monitor created but never alerts:
- Cause: threshold too strict, wrong query window, or not enough positive runs.
- Fix:
- Inspect history over a known active period:
scripts/monitor-history <deployment> <id> <startTime> <endTime>
- Reduce threshold or widen
rangeMinutes. - Tune
triggerAfterNPositiveResults/triggerFromNRuns.
- Inspect history over a known active period:
Too many alerts (noisy monitor):
- Cause: threshold too low or interval too short.
- Fix:
- Increase threshold.
- Increase
triggerAfterNPositiveResultsand/ortriggerFromNRuns. - Increase
intervalMinutesor narrow match conditions.
NewValues monitor sends too many notifications or its runs fail:
- Cause: the watched column holds too many distinct values, such as messages that contain IDs, timestamps, or numbers.
- Fix:
- Watch a column with fewer distinct values, or strip the variable parts in the query before
trackedValuereads it. - Filter the query, or aggregate and keep only the values that pass a bar.
- Shorten
lookbackDaysif the column holds 50,000 or more distinct values within it.
- Watch a column with fewer distinct values, or strip the variable parts in the query before
NewValues monitor misses a value:
- Cause: the event arrived after every run that covers its
_time, or the monitor had already recorded the value withinlookbackDays. - Fix:
- For late data, set
secondDelay, or setrangeMinuteslonger thanintervalMinutes. - Remember that a value alerts once, then not again until
lookbackDayspass without it.
- For late data, set
Notifier exists but no delivery:
- Cause: destination config invalid (URL/key/channel/email list), or destination-side rejection.
- Fix:
- Fetch notifier and verify destination fields:
scripts/notifier-get <deployment> <id>
- Recreate/update notifier with corrected properties:
scripts/notifier-update <deployment> <id> <json-file>
- Confirm monitor references correct notifier IDs.
- Fetch notifier and verify destination fields: