axiom-alerting

작성자: axiomhq

v2 공개 API를 통해 Axiom 모니터와 알리미를 생성하고 관리합니다. 알림 구축, 알림 라우팅, 모니터 동작 검증 등에 사용합니다.

npx skills add https://github.com/axiomhq/skills --skill axiom-alerting

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)

OperationMethodPath
ListGET/v2/monitors
GetGET/v2/monitors/{id}
HistoryGET/v2/monitors/{id}/history
CreatePOST/v2/monitors
UpdatePUT/v2/monitors/{id}
DeleteDELETE/v2/monitors/{id}

Notifiers (/v2/notifiers)

OperationMethodPath
ListGET/v2/notifiers
GetGET/v2/notifiers/{id}
CreatePOST/v2/notifiers
UpdatePUT/v2/notifiers/{id}
DeleteDELETE/v2/notifiers/{id}

Prerequisites

  1. Run scripts/setup
  2. Ensure .axiom.toml has 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

  1. Create notifier first.
  2. Create monitor and set notifierIds.
  3. Validate monitor behavior with monitor-history.
  4. Iterate monitor thresholds and schedule.

Workflow: End-To-End Alerting

  1. Run scripts/setup.
  2. List existing notifiers with scripts/notifier-list <deployment> and reuse one if appropriate.
  3. If no suitable notifier exists, create one with scripts/notifier-create.
  4. Create or update the monitor with notifierIds attached.
  5. Validate with scripts/monitor-history <deployment> <id> <startTime> <endTime>.
  6. If behavior is noisy or silent, tune threshold, rangeMinutes, intervalMinutes, and N-of-M trigger fields.
  7. Re-check history after each change.

Best Practices

  • Configure one channel per notifier.
  • Use emails (not recipients) for email notifier payloads.
  • Prefer triggerAfterNPositiveResults/triggerFromNRuns for noisy signals.
  • Use explicit bin() in monitor queries; avoid bin_auto() for alert logic.
  • For metrics-backed monitors, prefer mplQuery for definitions; API responses may include both aplQuery and mplQuery.

Monitor Types And Operators

Monitor types:

  • Threshold
  • MatchEvent
  • AnomalyDetection

Operators:

  • Above
  • Below
  • AboveOrEqual
  • BelowOrEqual
  • AboveOrBelow

Monitor Field Reference

Core fields:

  • name: Human-readable monitor name.
  • type: Threshold, MatchEvent, or AnomalyDetection.
  • 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.

Threshold and evaluation fields:

  • operator: Threshold comparison operator.
  • threshold: Numeric threshold value.
  • rangeMinutes: Query evaluation window in minutes.
  • intervalMinutes: Evaluation cadence in minutes.
  • 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.
  • secondDelay: Delay (seconds) to tolerate late-arriving data.

Type-specific fields:

  • columnName: Field used by some anomaly/value-anomaly monitors.

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": 5,
  "intervalMinutes": 5,
  "notifierIds": ["notifier-id"],
  "disabled": false
}

AnomalyDetection:

{
  "name": "CPU Anomaly",
  "type": "AnomalyDetection",
  "aplQuery": "['metrics'] | summarize avg(cpu_usage)",
  "columnName": "cpu_usage",
  "operator": "AboveOrBelow",
  "rangeMinutes": 5,
  "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/setup and retry:
      • scripts/notifier-list <deployment>

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> --json
      • scripts/notifier-list <deployment> --json

400 Bad Request on notifier create/update:

  • Cause: invalid notifier payload shape.
  • Fix:
    • Use one notifier channel inside properties.
    • For email, use emails (not recipients).
    • Validate against a known-good example and retry:
      • scripts/notifier-create <deployment> <json-file>

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, and notifierIds.
    • Confirm operator matches monitor type and threshold logic.
    • Retry:
      • scripts/monitor-create <deployment> <json-file>
      • scripts/monitor-update <deployment> <id> <json-file>

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.

Too many alerts (noisy monitor):

  • Cause: threshold too low or interval too short.
  • Fix:
    • Increase threshold.
    • Increase triggerAfterNPositiveResults and/or triggerFromNRuns.
    • Increase intervalMinutes or narrow match conditions.

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.

axiomhq의 다른 스킬

metrics-chart
axiomhq
Axiom 메트릭 쿼리 결과(application/vnd.metrics.v3+json)를 꺾은선 차트로 렌더링합니다. 기본적으로 제로-의존성 유니코드/ASCII를 사용하며, 인라인 PNG/SVG/sixel로 업그레이드할 수 있습니다...
official
spl-to-apl
axiomhq
Splunk SPL 쿼리를 Axiom APL로 변환합니다. 명령 매핑, 함수 동등 항목 및 구문 변환을 제공합니다. Splunk에서 마이그레이션할 때 사용합니다.
official
writing-evals
axiomhq
Axiom AI SDK를 위한 평가 스위트를 구성합니다. 자연어 설명으로부터 평가 파일, 스코어러, 플래그 스키마, 설정을 생성합니다. 다음을 생성할 때 사용합니다…
official
axiom-apl
axiomhq
APL 쿼리 언어 레퍼런스 for Axiom. 연산자, 함수, 패턴 및 CLI 사용법을 제공합니다. 전문화된 Axiom 스킬에 의해 작성 시 자동 호출됩니다…
official
detect-anomalies
axiomhq
Axiom 데이터셋에서 통계적 분석을 사용하여 이상 징후를 탐지합니다. 비정상적인 패턴, 볼륨 급증, 이상치 또는 새로운 오류 유형을 찾을 때 사용하세요.
official
explore-dataset
axiomhq
Axiom 데이터셋을 탐색하여 스키마, 필드, 볼륨 및 패턴을 이해합니다. 새 데이터셋을 발견하거나 데이터 구조를 조사할 때 사용합니다.
official
find-traces
axiomhq
Axiom에서 OpenTelemetry 분산 트레이스를 분석합니다. 트레이스 ID를 조사하거나, 기준(오류, 지연 시간, 서비스)별로 트레이스를 찾거나, 디버깅할 때 사용하세요…
official
gilfoyle
axiomhq
당신이 할 수 없는 일을 해내는 SRE 에이전트. 관측 가능성 스택을 조회합니다. 근본 원인을 찾아냅니다. 당황하지 않습니다. 추측하지 않습니다. 당신의 감정에 신경 쓰지 않습니다. 사용…
official